I am having the same problem. The form and form code has no errors. I can edit the form, sign it and publish it. I can even open the published form.
The only time I get the above error is if I try to debug the form in Visual Studio. I have infopath 2007, and VS 2008.
My solution has about 10 ...