zoukankan      html  css  js  c++  java
  • VS2010 项目引用了DLL文件,也写了Using,但是编译时提示:未能找到类型或命名空间名称 <转>

    昨天写了一个很小的winform程序,其中引用了自己写的两个dll文件。

    本来认为轻松搞定,结果一编译居然提示:未能找到类型或命名空间名称。。。。。

    于是删掉两个dll重新引用,再编译结果依旧!很是郁闷。

    后来经过调查,终于发现了解决方法:

    在项目上点右键-->属性-->应用程序-->目标框架-->修改为.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了。

  • 相关阅读:
    [转载]游戏外挂原理
    python cookbook
    RF user guide
    测试理论-selenium的工作原理
    测试理论- the conten of test plan
    测试理论--branch testing and boundary testing
    测试理论--向高级出发
    fiddler安装及配置
    python 面试题: 列表表达式
    [redis]如何将redis设置成diango的cache backend
  • 原文地址:https://www.cnblogs.com/host-2008/p/3817594.html
Copyright © 2011-2022 走看看