reflection - Prism + Log4Net build error : "Cannot resolve dependency to assembly log4net" -


i trying add log4net support in prism application. unfortunately following error each prism modules :

error 101 unknown build error, 'cannot resolve dependency assembly 'log4net, version=1.2.10.0, culture=neutral, publickeytoken=1b44e1d426115821' because has not been preloaded. when using reflectiononly apis, dependent assemblies must pre-loaded or loaded on demand through reflectiononlyassemblyresolve event.' [prism module 1 project name]

error 101 unknown build error, 'cannot resolve dependency assembly 'log4net, version=1.2.10.0, culture=neutral, publickeytoken=1b44e1d426115821' because has not been preloaded. when using reflectiononly apis, dependent assemblies must pre-loaded or loaded on demand through reflectiononlyassemblyresolve event.' [prism module 2 project name]

ect ...

i set logger follow :

  1. i added log4net assembly reference both main app, , bootstrapper.
  2. i added log4net configuration app.config file.
  3. i added [assembly: log4net.config.xmlconfigurator(watch = true)] app.xaml.cs file.
  4. i created logger implemeting iloggerfacade , overwrote createlogger() in bootstrapper make return custom logger.

that's it. if try build, fails error mentioned above each prism module project. work around found manually add log4net references each prism modules projects which, think, kind of defeats abstraction between iloggerfacade , dependencies of actual implementation.

the error suggest use reflectiononlyassemblyresolve event, don't see how here build error, not runtime.

any suggestion ? :-)

ok found problem, each modules referencing bootstrapper wrong, removed dependency , voila, fixed !


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -