InfoPath 2013: VSTA 2.0 web service breaks project

Some time ago an InfoPath form was build in InfoPath 2010 with two Web Services in its code behind. In order to edit the form with InfoPath 2013, a fresh project was made and the necessary components were moved from the existing project to the new one. When testing the form, everything worked fine. However, after closing and opening the form, when trying to open the Code Editor, the following message was returned: "The system cannot find the path specified." 

After some investigating I was able to reproduce the error on two distinct machines as follows:

  1. Create a new InfoPath 2010 Filler Form
  2. Create a Code Project with target version: InfoPath 2010
    Note that if you now save the form, then close and open it again, everything is still fine.
  3. Add a Web Reference
    I added <SharePoint 2010>/_vti_bin/lists.asmx
  4. Now save and close the project, save and close the form, open the form and open the Code Editor
  5. Observe the error message :'(

Note that you can still open (and fix) the project with VS2012. You will have to delete both the web service AND the Web References folder to be able to open the project in InfoPath again.

If you are able to reproduce this problem, please leave a comment. If you have a solution, even better.

May 8th, 2013 1:35pm

Any Resolution to this problem?  I am finding that I'm having this exact problem.
Free Windows Admin Tool Kit Click here and download it now
August 19th, 2013 9:10pm

Hello DraperAden,

Unfortunately I did not find a satisfying solution to this silly issue. Eventually, because of time constraints, I decided to downgrade the code to make it work.

August 19th, 2013 9:16pm

One workaround for the "system cannot find the path specified" problem is to remove the code (File | Advanced Form Options, Programming - Remove Code), then re-create a clean project and paste the old code, re-creating the references and web references by hand. A bit of a drag, but works.
Free Windows Admin Tool Kit Click here and download it now
November 21st, 2014 4:34am

Never mind my workaround, I should have read the original post more carefully, deleting the references is easier.
November 27th, 2014 6:46am

Ok, problem solved! Well, sort of, but I think this solution works better.

As Ruud has discovered, the problem relates to InfoPath getting confused about the SharePoint web reference. In fact, when running SysInternals ProcMon, I noticed a suspicious entry:

INFOPATH.EXE - Create File - C:\Users\david\My Documents\InfoPath Projects\Form1\http:\sharepoint\_vti_bin\lists.asmx%3fwsdl - NAME INVALID

That does certainly look like an invalid name! So, to work around this, simply stop using a web reference! Instead, start by adding a web reference (could be in a different VS project), and copy the generated Reference.cs file into your InfoPath code project! You'll need to make one tweak (a console project would use Properties for the URL), but other than that it will work fine.

The one disadvantage to this approach is that you don't get to update the reference automatically, but you don't care because it's a reference to SP that will not change.

  • Proposed as answer by DavidAir Thursday, November 27, 2014 4:00 AM
Free Windows Admin Tool Kit Click here and download it now
November 27th, 2014 7:00am

Best answer - definately solved my problem. Thank you for your research :)
January 8th, 2015 6:48am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics