Smi*_*ley 2 c# dll warnings reference
我正在尝试开发一个应用程序,但随后突然出现了这些警告.我试过禁用我的反病毒(Avira),但它仍然无法正常工作.
Warning 1 Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not load file or assembly 'MyAssembly.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. ConsoleApplication1
Warning 2 The referenced component 'MyAssembly' could not be found.
Run Code Online (Sandbox Code Playgroud)
有人可以帮帮我吗?谢谢!
您正在开发的应用程序是什么.NET运行时版本?
如果要信任该错误,您的项目就是一个.NET 3.5(2.0运行时)项目,但MyAssembly库是在.NET 4.0中开发的,导致您看到错误.
您不能在较旧的运行时版本项目中引用较新的运行时版本程序集.您必须"升级"您的项目,以至少匹配给您的程序集的框架版本.
右键单击项目文件,然后选择属性.根据您使用的Visual Studio版本,此屏幕可能看起来不同,但请转到应用程序选项卡,查看目标框架是什么.

然后转到引用中引用的程序集,并检查属性部分中的"运行时版本":

| 归档时间: |
|
| 查看次数: |
31555 次 |
| 最近记录: |