By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,877 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,877 IT Pros & Developers. It's quick & easy.

Problems using dsofile.dll in ASP.NET

P: 1
This post is in regard to archived discussion:

http://www.thescripts.com/forum/thread103110.html

Here is important information about dsofile.dll from an ASP.NET 2.0 application with regard to access rights/file security:

I ran into security access violations when I tried to access a file on a network share using impersonation and read the summary properties using dsofile.dll.

It turns out that COM components (such as dsofile.dll) are single threaded apartments (STA) whereas the ASP.NET page normally runs in a multiple threaded apartment (MTA). When a MTA calls into a STA in ASP.NET 2.0 it drops the impersonated identity on the calling thread and uses the aspnet_wp.exe to make the call regardless of your authentication method. The workaround is to add this page directive: AspCompat="true"
and make the call through a web page and not global.asax for instance.

It should be noted that there is a performance penalty for running a page in AspCompat mode.

More info:

http://support.microsoft.com/kb/325791/EN-US
Jul 25 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.