Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS Express Access denied

Tags:

c#

iis-express

I am trying to create new file in visual studio 2012

fileStream = new FileStream("google_com.txt", FileMode.CreateNew);

But i keep getting this error Access to the path 'C:\Program Files (x86)\IIS Express\google_com.txt' is denied.

Plz help to fix this poblem.

like image 942
Zia ur Rehman Avatar asked Apr 11 '14 19:04

Zia ur Rehman


2 Answers

Solutions:

  1. Put a specific location for google_com.txt file. like C:\google_com.txt. Actually it is not allowing to create the file in default location(inside program files) as it might not have the proper privilege.
  2. If you want to create the file in default location(inside program files) run Visual Studio as Administrator.(R-Click-> Run as Administrator).
like image 119
Shreyos Adikari Avatar answered Sep 30 '22 00:09

Shreyos Adikari


Run Visual Studio as Administrator

like image 37
Raja Nadar Avatar answered Sep 30 '22 01:09

Raja Nadar