0

I am trying to debug an asp.net code in VS 2012. i press the debug tab ->start debugging. the debug is in web browser explorer.

So a webpage is opened with this address: http: //localhost:27970/hellow.aspx on this page i have an file uploader. and the page tries to save it. It is supposed to go to a network drive D:\ and save it there. here it fails and i am getting this error:

Access to the path'D:\upload_files\WebTesting\Test\5_12_2013_13_50_32_material.txt' is denied. 
Description: An unhandled exception occurred during the execution of the current
web request. Please review the stack trace for more information about the error and
where it originated in the code. 
ASP.NET is not authorized to access the requested resource. Consider granting
access rights to the resource to the ASP.NET request identity. ASP.NET has a base 
process identity.

I also want to mention that this app is already working and i am just wanted to add some features. When i try to do the same actions in the website(before my changes) ,the file uploading has no problem, the problem is only in the debugging process.

I guess it has something to do with IIS. but i am not familiar with the IIS at all.

Any ideas?

Damon
  • 3,004
  • 7
  • 24
  • 28
Vera
  • 99
  • 1
  • 7
  • 2
    you need to add permissions to the folder you are accessing - this would be your user account on the network share but also possibly the network service/ASPNET user accounts too. Check the app pool to see what the user account is being used to serve up the website – Ahmed ilyas Dec 05 '13 at 13:54
  • Yep, you need to give folder permission to the appPool account that runs the web app. – Lee Harrison Dec 05 '13 at 14:01
  • are you running Visual Studio as administrator? – Wim Ombelets Dec 05 '13 at 14:06
  • can you please explain how do this? i am new with all the asp.net and IIS developing. i don't have ASPNET option in the network service. – Vera Dec 05 '13 at 14:09
  • answered [here](http://stackoverflow.com/questions/9654833/how-to-run-visual-studio-as-administrator-by-default) – Wim Ombelets Dec 05 '13 at 14:13
  • this solution is not working unfortunately. can i get more detailed explanation about the appPool please? – Vera Dec 05 '13 at 14:27

0 Answers0