开发者

No compile errors when reference added, but errors seen upon build

A solution was just converted from VS 2008 to VS 2010. My VS 2010 build is failing with the popular "The type or namespace X could not be found". When I go to 开发者_如何转开发the project and go to Add References and add the appropriate project dll, the class name appears in blue text as if .NET found the correct class. However, when I go to the Build menu and select "Build Solution" I get the "namespace not found error" and the class name is no longer blue.

Thanks.


Your project is probably using the .NET 4.0 Client Profile, rather than the full .NET 4.0 framework.

Go to Project > Properties > Application and set "Target framework" to .NET Framework 4.

For some reason Microsoft set this as the default framework instead of the full one for projects in VS2010, and compilation fails with this cryptic error message for any referenced types/namespaces in assemblies which were built against the full framework.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜