Question

I'm working on an application that logs through common.logging, common.logging.nlog and then nlog. Logging works fine in the application - web.config is OK.

However - when I apply the logging configuration to my App.config of the test project, the logging does not work, stating:

Unable to create type 'Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog'

Innerexception is a 'unable to load assembly from file'.

Here's the packages:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Common.Logging" version="2.1.2" targetFramework="net40" />
  <package id="Common.Logging.NLog" version="2.0.0" targetFramework="net40" />
  <package id="EntityFramework" version="5.0.0" targetFramework="net45" />
  <package id="FakeDbSet" version="1.4.0.0" targetFramework="net45" />
  <package id="FluentAssertions" version="2.0.1" targetFramework="net40" />
  <package id="Moq" version="4.0.10827" targetFramework="net45" />
  <package id="NLog" version="2.0.1.2" targetFramework="net40" />
</packages>

EDIT

And here's the project file

    <Reference Include="Common.Logging, Version=2.1.2.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\packages\Common.Logging.2.1.2\lib\net40\Common.Logging.dll</HintPath>
      <Private>True</Private>
    </Reference>
    <Reference Include="Common.Logging.NLog">


<HintPath>..\packages\Common.Logging.NLog.2.0.0\lib\2.0\Common.Logging.NLog.dll</HintPath>
  <Private>True</Private>
</Reference>
    <Reference Include="NLog">
  <HintPath>..\packages\NLog.2.0.1.2\lib\net40\NLog.dll</HintPath>
  <Private>True</Private>
</Reference>

If I go to the /testresults/.../out folder - there is Common.Logging in there, but not the other two required libs ( common.logging.nlog and nlog ). Both of them are referenced in the project AND have 'copy local' set to true.

Any clues?

Was it helpful?

Solution

It's a bug in VS2012 - @jbl helped me out - use this link: stackoverflow.com/a/8213977/1236044

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top