1.

在项目上点右键-->属性-->应用程序-->目标框架-->修改为.NET Framework 4。

而我原来的设置是.NET Framework 4 Client Profile。问题就出在这里。

以下是MSDN给出的提示:

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了。

2.

检查Dll.net版本与当前项目是否一致,90%不一致。

相关文章:

  • 2021-09-16
  • 2022-02-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-29
  • 2022-12-23
猜你喜欢
  • 2021-06-20
  • 2022-12-23
  • 2021-08-10
  • 2021-06-07
  • 2022-12-23
  • 2021-10-20
相关资源
相似解决方案