views:

372

answers:

2

Hello,

I have ASP.Net web app and my c# code calls into a custom COM DLL.

The DLL was written awhile back and uses fOpen. he fOpen calls return a NULL pointer. I am suspecting it is permissions, but I am having no luck in recolving the issue.

Can anyone give me any ideas of what to do? Can fOpen be used? Are there special permissions I need to set?

Any help would be greatly appreciated.

Thanks, Tony

A: 

The issue is most likely with the file it's actually trying to open. The file Asp.Net worker process likely doesn't have permission to access that file on the file system. You'll need to add access to the worker process and that should fix the issue.

This page details how to set permissions for Asp.Net 1.1. It should be fairly similar for later versions of Asp.Net

http://www.asp.net/learn/whitepapers/aspnet-and-iis6/

JaredPar
Yes, that could be. I am not familiar with the 'worker process.' Where would I add the permissions?
Tony
Well, I did exactly what is explained in the article and it still fails. Any other possibilities?I really appreciate the help, this one has got me stumped.
Tony
A: 

Some things to check:

  • The trust level of the ASP.Net app
  • Are you passing the correct path to the dll (mapping to the local file system vs web file system)?
  • Does the account used to run the site have sufficient permissions to access the file?
Joel Coehoorn
Ok, more info that may help. The DLL is hardcoded to use D:\Path. So my web server does not have drive D, so I used SUBST to create a cirtual drive. I also tried sharing the directory and then mapped a drive D.Would either of those matter?
Tony
It's probably a permissions issue accessing your mapped or virtual drive.
Joel Coehoorn