开发者

Is it possible to extract Global.asax into a common library outside of the websites bin directory?

开发者 https://www.devze.com 2023-03-25 13:00 出处:网络
Using the solution in this question, I moved my MvcApplication logic to a SharedHttpApplication class in my common library that inherits from HttpApplication.

Using the solution in this question, I moved my MvcApplication logic to a SharedHttpApplication class in my common library that inherits from HttpApplication.

In my asp.net mvc 3 project, I have my Global.asax MvcApplication inherit from my SharedHttpApplication.

My common library Assembly lives on the server file system in a standard lo开发者_如何学运维cation, and I am trying to prevent having to copy local to keep it in one place.

I am not getting a parser error for line one of my Global.asax page. I've read this is because the DLL containing the application is not in the bin directory.

Does anyone have a solution for what I'm trying to do here?

Thanks in advance for any help!


The only way I believe you can do what you're talking about it by installing the shared DLL to the GAC. That will make it accessible to anything on the server. If you don't care about the security implications of that, then that could be the way to go.

http://msdn.microsoft.com/en-us/library/dkkx7f79.aspx

Otherwise, copying the dll to each of the application's bin folders is not really bad practice, as long as you have a good deployment strategy in place for that.

0

精彩评论

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