【问题标题】:Primary reference could not be resolved?? (VB.NET)主要参考无法解决?? (VB.NET)
【发布时间】:2013-10-24 09:25:06
【问题描述】:

我正在尝试使用 MySQL DLL 文件将 vb.net 2010 连接到 SQL 数据库,但是每当我编译它时,我都会收到以下错误:

Warning 1   The primary reference "MySql.Data" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client".   SQL

我也在我的桌面上尝试过它(也在 windows 8.1 上运行 vb 2010)但是它不会编译,但是在 windows 7 PC 上它编译没有问题,尽管设置似乎是一样。

有什么想法吗?

【问题讨论】:

    标签: mysql .net sql vb.net dll


    【解决方案1】:
    1. 通过在解决方案中右键单击建模项目来卸载它 资源管理器窗口并选择“卸载项目”。
    2. 然后右键点击edit projectname.modelproj.
    3. 然后添加以下代码。
    <PropertyGroup>
    <ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch>true</ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch>
    </PropertyGroup>
    

    【讨论】:

    • “卸载建模项目” 下层项目吧?
    【解决方案2】:

    将您的项目属性从target framework version 更改为4.5 或添加低版本的引用以匹配您自己的版本(3.5、4.0)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-04-24
      • 1970-01-01
      • 1970-01-01
      • 2017-10-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多