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

问题描述 投票:0回答:2

我试图使用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
2个回答
0
投票

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


0
投票
  1. 通过在“解决方案资源管理器”窗口中右键单击并选择“卸载项目”来卸载建模项目。
  2. 然后右键单击并单击编辑projectname.modelproj。
  3. 然后添加以下代码。
<PropertyGroup>
<ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch>true</ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch>
</PropertyGroup>
© www.soinside.com 2019 - 2024. All rights reserved.