Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dependency reference issues in VS2012 on Windows 8

I've got a solution with several projects, many of which reference Apache's log4net. I am currently trying to build just one of these projects (a class library) to resolve a reference issue I'm having, but no luck yet.

The warnings and errors only occur when building in VS2012 on Windows 8, and not in VS2010 on Windows 7.

Anyone have any ideas how I might resolve this? Here's the warning messages;

The primary reference "log4net" could not be resolved because it was built against the ".NETFramework,Version=v4.0.1,Profile=Client" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client".

And here's the error messages:

The type or namespace name 'log4net' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Rune\Documents\Team Foundation Server\noOdin\Yggdrasil\OdinLib\Common.cs

The type or namespace name 'ILog' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Rune\Documents\Team Foundation Server\noOdin\Yggdrasil\OdinLib\Common.cs

I'm ignoring the errors right now, as they're a result of the log4net reference not loading.

The reference is included in my .csproj file like this:

<Reference Include="log4net"><HintPath>..\..\Dependencies\log4net.dll</HintPath></Reference>

As such the problems is really the warning I'm getting, since it seems to find my log4net.dll file in my Dependencies folder.

Any one know how i might solve that?

Please do ask if you need more information.

like image 769
Khereth Avatar asked Nov 24 '12 19:11

Khereth


Video Answer


1 Answers

The <SpecificVersion>False</SpecificVersion> was missing in the csproj-file which forced a specific version of the log4net-library.

Adding this answer in an effort to the question out of the unanswered list :)

like image 121
flindeberg Avatar answered Oct 18 '22 02:10

flindeberg