FilePath

I did try that, it still fails at "if file.exists" line.

This is what an ex-coworker said but not sure if this is correct and if so how can I give it access


When you run ASP.NET applications it runs in a different security context to you as a user. Therefore the resources that you have access to are not necessarily the same as the resources as the ASP.NET application.

You will have to grant access to the account ASP.NET is using to the share.
You can find out the name of the account from IIS - In the properties for the virtual directory, select the Directory Security tab, press the Edit button in the Anonymous Access and Authentication Control group. The dialog will be displaying the account ASP.NET is using for anonymous access.
 
ASP.Net applications run as the <machinename>\ASPNET account - this account only exists on the local machine and as such cannot be given permissions to network resources.
Impersonation is probably the way to go - search these forums and you should get a few hits on the subject, failing that reply here and I'll see what I can dig up.
 
well, dang it. This works great on my laptop.

I setup the app on the production machine. I moved the code. I have :
<identity impersonate="true" />
and Anonomous Authentication unchecked


Just like my laptop.

When I go to the production URL, I get a "enter network password" box.!!!

WHY??? Then I enter my windows userid/password/domain but it doesnt take it.

I also went to Tools/ Options/advanced/ and checked "Enable windows intergrated authentication, closed browser, reopened it But still got the box.

Why??? Any ideas on what to do??
 
You could have your network administrator make an account for asp that is domain level then give that level the appropriate permissions and then set your aspnet to run as that domain user rather than the local ASPNET account. Not sure how that portion is done, maybe PD can help with that part.
 
I found out that the production machine is in "DMZ" zone and file sharing is blocked, we can only FTP files from that machine to other machines we have on the network...

Now, if the Network admin creates " domain level then give that level the appropriate permissions "... Can I access the files?? or do I still need to somehow code FTP in my app??
 
Just make sure you Domain Admin does it right and doesn't do something generic and end up giving Domain Administrative permissions to the ASP net account - believe me I work in that field and not all of them are that bright. Ideally it should be a User account that does not have the ability to log on to any local machines, connect to any servers, etc... it only has permission to access the file groups you are trying to access.... otherwise you could be exposing your entire network to hackers.
 
Back
Top