主要参考无法解决? (VB.NET)

时间:2013-10-24 09:25:06

标签: mysql .net sql vb.net dll

我正在尝试使用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上它编译没有问题,尽管设置似乎是是一样的。

有什么想法吗?

2 个答案:

答案 0 :(得分:0)

将项目属性更改为target framework version4.5 或添加较低版本的引用以匹配您自己的版本(3.5,4.0)

答案 1 :(得分:0)

  1. 在解决方案中右键单击以卸载建模项目 资源管理器窗口,然后选择“卸载项目”。
  2. 然后右键单击并单击编辑projectname.modelproj。
  3. 然后向其中添加以下代码。
<PropertyGroup>
<ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch>true</ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch>
</PropertyGroup>