NLog.Extended not copied to my web project

I have a solution with two projects:

Project 1: Wrapper.Dll containing the NLog shell. NLog and NLog.Extended are installed using Nuget.

Project 2: - This is an ASP.Net MVC project that contains a link to project 1.

When I try to start a web project, it throws an exception because NLog is trying to load the target rendering from NLog.Extended.Dll.

If I checked the bin directory of Wrapper.dll, I have NLog.Dll and NLog.Extended.Dll.

If I check the bin directory in a web project, I only have NLog.dll.

How can I tell Visual Studio to copy the NLog.Extended.Dll file from project 1 to project 2?

EDIT: Adding some dead code that uses something from NLog.Extended.Dll makes the file copied. Are there any cleaner solutions?

thank

+3
source share
2 answers

Unfortunately no, there is no cleaner solution. If no object from the NLog.Extended assembly references (directly or indirectly) your code, it does not copy it. This, of course, is a problem, since layouts are just strings, not a direct link. You could use the post-build event, but this is, in my opinion, a uglier solution.

+1
source

You can add a link to NLog.Extended.dlla web project if it depends on it.

0
source

All Articles