Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

Cannot resolve dependency to assembly ### because it has not been preloaded.

$
0
0

Hi, all:

My .NET solution includes about 40 projects, and now I am adding log4net for my logging need. I create a wrapper project that reference to log4net.dll, this wrapper project simplifies the calling, and I also want all other projects reference to this wrapper project instead of reference to the log4net.dll. But it looks like that I still need to add the log4net.dll to the reference to all my projects beside all the projects reference to my wrapper project and the wrapper project reference to log4net.dll already. If I do not add log4net.dll to my other projects, I will get compile error:

Error    3    Unknown build error, 'Cannot resolve dependency to assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=null' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.' 

Is this by design? Do I always add the 3rd referenced dll to the main project, if the main project reference to the 2nd project and the 2nd project reference to the 3rd dll? Is there a workaround? I wanted the other projects reference to the wrapper project only as the wrapper project reference to the log4net.dll already.

Thanks

-rockdale

 

 

 

 


Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>