微信号:
当前位置:首页 > 资讯文摘 > 新闻资讯

未能找到类型或命名空间解决方案-c# winform开发错误

2015/5/28 23:25:30

网站建设软件开发时,已经引用dll或其他项目的命名空间,还是提示未能找到类型或命名空间错。

解决方案:

查看项目-》属性-》应用程序-》目标框架是不是.NET Framework 4 Client Profile。

.NET Framework 4 Client Profile修改为.NET Framework 4。

 

If you are targeting the .NET Framework 4 Client Profile, you cannot reference an assembly that is not in the .NET Framework 4 Client Profile. Instead you must target the .NET Framework 4.

 

不 过也因为如此,当在 Visual Studio 2010 建立新项目时,如果发现 [添加引用] 中没有列出原本应该列出的组件或者引用的其他程序集,在代码中的调用一直提示找不到名字空间时,可以先检查是否是项目的 target framework 设成了 .NET 4.0 Client Profile (例如 System.Web.dll 就不在 .NET 4.0 Client Profile 套件中),若是改成.NET Framework 4就OK了。

相关新闻: