Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2008 Web Deployment Project Section Replacement with Elmah

I'm using a web deployment project and want to do some section replacement with the emlah/errorMail section. I don't want to send emails in debug build mode.

I have created the custom section and put it in an errorMail.config. In the properties of web deploy project under replacements, I have elmah/errorMail=errorMail.config.

The error I'm getting is An error occurred creating the configuration section handler for elmah/errorMail: Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified.

I'm guessing this is happening because Elmah is not in the GAC or it's not one of my projects. The Elmah.dll file does copy to the output\bin folder just fine though.

Is there a way to have section replacements work with 3rd party dlls?

[EDIT]

I found that if I drop the dll in question into the project folder for the web deployment project, that it will work fine. This is less than optimal.

So now my question is, how can I get this to work without having to put the dll in the GAC or having to copy the dll into the web deployment project folder?

like image 457
Josh Close Avatar asked May 13 '09 17:05

Josh Close


1 Answers

If you add a reference to the elmah dll from your webproject, then it will automatically copy the dll to the output folder when you build it.

Those are the only 2 options though: to have the dll copied to the output directory or to put it in the GAC

like image 138
Matthew Steeples Avatar answered Oct 05 '22 23:10

Matthew Steeples