Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use multiple versions of nlog

I'm new to nlog, pardon my ignorance if I've missed something trivial.

I'm hosting several applications using IIS7, some use nlog 1.0.0.505 and some use NLog 2.0. I'm not sure how to create a web.config to accomodate both versions.

Is it possible to put several versions of the nlog.dll into the GAC so that each application has a list of versions to select from?

Is it perhaps a better idea to remove nlog from the GAC and let the application use the nlog it was deployed with? In that case, how do I reference nlog in web.config (to set targets etc)

Would greatly appreciate any help or pointers to where I can read more.

Thanks in advance.

like image 305
Dennis S Avatar asked Oct 26 '25 15:10

Dennis S


2 Answers

You'll want to create separate App Domains for each application or at least for each application that uses a different version of a dependent dll. A single App Domain can't load multiple versions of the same dll.

like image 189
Samuel Neff Avatar answered Oct 29 '25 06:10

Samuel Neff


We ended up letting the application provide the nlog.dll file and did not specify version number in the global web.config.

like image 36
Dennis S Avatar answered Oct 29 '25 07:10

Dennis S



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!