Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reference Component could not be found

i'm trying to develop an application but then these warnings popped out. I have tried disabling my anti-virus (Avira) but it still won't work.

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. 

Can anybody please help me? Thanks!

like image 633
Smiley Avatar asked May 21 '11 06:05

Smiley


1 Answers

What .NET runtime version is your application being developed with?

If the error is to be trusted, your project is say a .NET 3.5 (2.0 runtime) project but the MyAssembly library is developed in .NET 4.0 resulting in the error you see.

You cannot reference newer runtime version assemblies in an older runtime version project. You'd have to "upgrade" your project to at least match the framework version of the assembly given to you.

Right click on your project file and choose properties. Depending on what version of Visual Studio you are using this screen may look different, but go to the application tab and see what the target framework is.

Project Properties

Then go to the assembly you referenced in your references and check the "Runtime Version" in the properties section:

Ref

like image 116
Khepri Avatar answered Sep 24 '22 13:09

Khepri