开发者

IIS and ASP.NET is locking my PInvoke dll

I have an ASP.NET MVC website that uses an internal dll for some PInvoke stuff. The dll is located in the /bin folder next to the other assemblies. This works well, but if I want to replace the content of the /bin folder with the newest set of files by copying onto the existing files (this is on a t开发者_如何学JAVAest server) the PInvoke dll is locked/used by the w3wp.exe worker process and cannot be replaced except after you recycle the apppool or restart IIS.

Is this standard behavior or can I somehow instruct the ASP.NET runtime to take a shadow copy of the PInvoke dll similar to the regular assemblies?


AFAIK, if the IIS has an handle of the DLL, you won't be able to replace the DLL.

You mentioned APPPool Recycle, and IIS Restart...

I guess you may not have used touching your web.config file. I mean, open your web.config in notepad, make a change [like add a space and remove it] and save the file. This will recycle your application domain and hence the assembly reference should ideally be released [unless it is a shared assembly].

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜