1

I have a visual studio solution which works fine on one machine and when I copy the complete same solution to another machine it misses few external dlls. Both the machine have same configuration and same version of visual studio.

I tried removing reference and adding again.I am able to reference the dll and use code but when I re-build,It gives the same error.Any pointers on what could have gone wrong?

The error message I get is as below

The type or namespace name 'NameSpaceName" could not be found (are you missing a using directive or an assembly reference?)

Also the warning shows.

The primary reference "NameSpaceName" 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".

Both the machine have Visual Studio 2010 installed. It works on one and doesn't work on another machine

Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
CoolDiva
  • 209
  • 1
  • 3
  • 14

1 Answers1

0

The reference you have added to the project is likely not in a subfolder of your project but referenced from the Global Assembly Cache (GAC). Since you probably didn't copy the GAC, this reference is now of a different version. Figure out which (3rd party ?) component is affected and install an older version of that component.

Typically, Visual Studio cannot target .NET 4.5, unless you applied a workaround. In that case, you can go to the project properties, Application and change Target Framework from 4.0 to 4.5.

Target Framework in Visual Studio properties

Community
  • 1
  • 1
Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
  • The machine where solution works has VS 2010 and there also the framework is 4.0, still it is able to reference the dll which is 4.5. Moreover I do not get a version higher than 4 in dropdown – CoolDiva Sep 01 '15 at 11:50
  • @CoolDiva: from where do you reference the DLL? Is it a DLL from GAC? In that case, install the same version of the 3rd party product as on the source PC. – Thomas Weller Sep 01 '15 at 19:26