When trying to build InfoPath 2007 forms from visual studio 2008, sometimes I got error message "the operation could not be completed" and could not open the form. This is frustrating, because no further details of that error.
After fighting with this issue many times in the past three years, I guess I found the reason.
There are some bugs in Visual Studio (I believe).
1. When we change the location of the InfoPath project, such as moved to another computer, moved to another folder, checked into TFS server, then been opened by another developer from another computer, etc. This problem might pop up.
2. There are several xml files in the folder "InfoPath Form Template" as below. The smallest inconsistence in these files would also cause this problem.
3. Visual Studio has its own cache in memory and file system. Sometimes the old version xml file in cache may be checked into TFS.
So, how to fix this issue?
- Make sure there is enough ram on you development workstation
- Reboot Visual Studio
- Be careful with the file "manifest.xsf".
- Keep a separate backup manually once the form is published successfully. TFS is not enough.
- If there are more than one form in a solution (one project per form), only keep one project "active". Unload other projects.
- Always check out the whole project before editing anything in it.
If cannot figure out the reason, or don't want to spend hours on trouble shooting, roll back to the previous backup. I know it's not a good idea, but maybe it's the best way.
If anyone get any thoughts, please let me know.