开发者

Using a 3rd party COM dll in ASP.NET

开发者 https://www.devze.com 2023-01-29 09:40 出处:网络
I have an ASP.NET project using a COM dll. When I load the site, I login without a problem and I can browse the site fine as long as I开发者_运维问答 don\'t go to a page which uses the COM library.

I have an ASP.NET project using a COM dll. When I load the site, I login without a problem and I can browse the site fine as long as I开发者_运维问答 don't go to a page which uses the COM library.

When I go to a page which uses the COM library to get data from a database, the page loads fine. The problem comes when I navigate away form this page. For some reason I am sent back to the login page as if the initial session was dropped.

If I take away the component on the page which displays the data which the library retrieves, I can navigate away from the page, so it is definitely the call to the library that kills the session.

Does anyone have any idea why this could happen??


Fixed it. It was a silly problem. The library created a log file in the bin directory every time it did something. The session gets dropped everytime there's a change in a file in the bin directory because the AppDomain gets destroyed and restarted.


I wonder if the COM component crashes and tears down your application pool (or whatever it's called these days in ASP.NET).

Can you keep an eye on the ASP.NET worker process (it used to be called aspnetwp.exe) and see if it disappears when you navigate to the page with the COM calls?

If so, the COM component probably throws a structured exception, which terminates the process, causing your session state to be lost, if you store it in-process on the server.

You might be able to glean more information from the Event Viewer (Start -> Run -> eventvwr), where ASP.NET logs any crashes.

0

精彩评论

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