开发者

Elmah on MVC website with WordPress/php sub directory

开发者 https://www.devze.com 2022-12-29 09:31 出处:网络
I have created a website using ASP.NET MVC and use ELMAH for error handling, this works perfectly. After setting up a virtual directory on my website under /blog and adding 开发者_如何转开发the necess

I have created a website using ASP.NET MVC and use ELMAH for error handling, this works perfectly. After setting up a virtual directory on my website under /blog and adding 开发者_如何转开发the necessary WordPress php files and mysql db, I get the below error come up.

Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified.

I think this has something to do with the fact that ELMAH is applying itself to all sub-directories.

Is there a way that I can tell ELMAH to ignore everything under /blog? Or is there a way to get around this?

Thanks in advance.


Copy the MVC project's Web.config into the /blog subdirectory, and inside it, change all of the Elmah-related handlers <add name="Elmah" etc. etc. /> to <remove name="Elmah" /> - that should sort it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号