Vb.net – Unable to open module file System Error &H80070002&

vb.netvisual studio 2010xsd

I've been handed a vb.net forms program built in what I suspect to be VS2010.
I'm trying to compile it and I get the following error:

Unable to open module file '<path>\file.vb': System Error &H80070002&

I've checked and i don't have a file.vb.

The strange thing is that i get this error when opening up a file called 'file.xsd', which is clearly not 'file.vb' (hence my confusion). I've searched my code and I can't find a reference to file.vb either.

So, why is it that when I try to open file.xsd, visual studio can't find the module file file.vb?

Best Answer

It looks like "file.xsd" uses a designer file which it thought was file.vb (I'm guessing that's a relic from an earlier version of Visual Studio).

So, I removed the file.xsd from my project, attempted to build it (it failed, of coure), and then added file.xsd back. Then I right-clicked on file.xsd and ran the custom Tool which was set to 'MSDataSetGenerator'. That created a designer file in the background and I was able to build my project. There is now a file.designer.vb file in my project, and it appears to be working smoothly.

Thanks for the help Craig!