Why would I get “The type of namespace name 'bla' does not exist…” after no changes?

落花浮王杯 提交于 2019-12-13 04:23:02

问题


Why would I go from building with no errors to 3 of the type:

The type of namespace name 'bla' does not exist in the class or namespace 'blah' (are you missing an assembly reference?)

All three errors refer to the same group of files (two errors in "OpenNETCF" and one in "OpenNETCF.Win32"); How could it be that these types did exist in the class earlier in the day, and now they don't? I didn't remove or update those references...

UPDATE

When I went to compile this (the next) morning in the VM (XP Mode), I got:

Automatic Updates
Updating your computer is almost complete. Your computer needs to be restarted for the updates to take effect. Windows will restart your computer automatically in .... minutes.

I got this yesterday, too, and didn't think much of it - just clicked the Restart Now button.

After restarting and building, I get 0 errors again, so it was apparently not a problem with the code itself.

I don't know if this is pertinent, but I also got today (both times the XP Mode VM started up):

Devices or applications disabled
'Virtual PC/Windows CE Emulator' will cause Windows to become unstable. Windows has prevented these drivers from loading. Click here for more details.

...which took me to: http://support.microsoft.com/default.aspx?scid=kb;en-us;891667


回答1:


One thing to check is to see if your project is accidentally set to use the .NET client profile. That cause all kinds of odd 'unknown type' problems.

To check, go to your project properties, then to the Application tab, and check the "Target Framework" setting. If it's set to ".NET Framework 4 Client Profile", try changing it to ".NET Framework 4" and rebuild to see that's what's causing it.




回答2:


It's simply a matter of restarting, and letting Visual Studio get its breath back.



来源:https://stackoverflow.com/questions/14719612/why-would-i-get-the-type-of-namespace-name-bla-does-not-exist-after-no-ch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!