Reputation: 17196
I can't solve this problem
I suggest I have to change c:\Windows\System32\drivers\etc\hosts
file and add after
# localhost name resolution is handled within DNS itself.
the next line:
127.0.0.1 mysite.dev
but it doesn't help. Any suggestions?
Error ocсurrs when I try to open web site project in Microsoft Visual Studio 2012.
Upvotes: 105
Views: 98007
Reputation: 1096
Thanks to @saminpa, I found this comment helpful in my situation, so, I added it as an answer to be found easily.
If the .vs
folder is encrypted by the NTFS encryption system (EFS), this error will be seen.
Upvotes: 0
Reputation: 900
simply fix for me
Close your Visual Studio
o remove .vs in .Net
o remove IISExpress in Documents
Reopen it, everything should be fine
Upvotes: 0
Reputation: 55
I was able to resolve this by editing the file *.csproj in the root level of the project. I changed and from localhost to the site name as shown below. It may also be required to have the OverrideIISAppRootUrl set to True.
Upvotes: 1
Reputation: 11
Creation of the virtual directory xxxx failed with error: Object reference not set to an instance of an instance of an object...
Error Screenshot This issue happened to me after deleting my local repository and downloading the repository from the cloud.
Per one of the solutions above, I deleted the .vs folder with no luck. To solve the issue, I ended up mixing a couple of the solutions in this forum.
I went to the folder .vs/SolutionName/config and pasted the applicationHost.config file from the latest subfolder on the folder C:/inetpub/history/
After that, I restarted VS and the error disappeared.
Upvotes: 0
Reputation: 55
I had to somewhat combine some of the above answers. My solution was to edit (not delete) the file .vs\config\applicationhost.config
There is a section for the bindings of the site, simply change from localhost to whatever you desire to run it under. Note that the port numbers are in front of the server name.
Upvotes: 1
Reputation: 1
I wanted open an exiting project of Visual Studio 2017 in VS 2019 and encountered with the same issue. I find its a version related problem. The solution is: Create a new project in the newer VS and copy the codes from the older VS.
Upvotes: 0
Reputation: 161
The issue can be fixed by deleting the folder named .vs in the project directory.
This solves the problem because while opening the project after deleting the .vs file, it creates the same folder with subfolder config and folder with project name.
The config folder applicationhost contains the necessary settings required to run the project successfully.
Upvotes: 12
Reputation: 115
<IISUrl>
of .csproj
with
<CustomServerUrl>
.Edit :
netsh http add iplisten 0.0.0.0
and see whether it solves the issue.Hope these would help someone still looking for a way.
Upvotes: 3
Reputation: 12324
My issue was with Windows 10 Defender. I had given IIS permission in the past, but seems like it is now ignoring it. Will look into it later, but for now I disabled controlled folder access and it worked.
Upvotes: 0
Reputation: 9
So here are the steps to fix it:
Upvotes: -1
Reputation: 1459
I just went to the directory named in the error and renamed the applicationhost.config and restarted and VS created a new file and ran fine.
Upvotes: 7
Reputation: 21
Not the exact same error, but I was lead to this answer since the first half of the error matched. Your applicationhost.config file may simply be read-only. Taking that off solved the error for me. That error calls out the file specifically though, so you should be able to find it easily.
Upvotes: 1
Reputation: 12597
More often than not, at least in my case, this happens is when a *.csproj.user
file is in the project directory and has <UseIISExpress>true</UseIISExpress>
in it.
Alternatively, as mentioned by Zachary Cutler you can also simply: close Visual Studio, delete the
*.csproj.user
file and reopen Visual Studio. This will force VS to rebuild the file.
Upvotes: 214
Reputation: 13607
I know this is probably a rare occurrence, but figured I'd put it here:
My csproj
file was set to "read only" (Don't ask me how I managed that), but after I turned off "read only" access, everything was fine. (VS2017)
Upvotes: 1
Reputation: 17196
I've already found the solution. I just had to edit C:\Users\Administrator\Documents\IISExpress\config\applicationhost.config
file, by adding my site to <sites>
node.
Upvotes: 38
Reputation: 547
The problem would be your project setup to be executed in the local IIS and the URL specified not exist.
There are options you can do to fix the problem.
Option 1 : (Use IIS Express)
1.) Open you web project .csproj file as XAML or in notepad.
2.) Find these properties and set according to your preferences.
UseIIS = false
UseIISExpress = true
and that's it.
Option 2 : (Use local IIS)
Follow the option 1 steps but change the following properties.
UseIIS = true
IISUrl = https://localhost
UseIISExpress = false
Upvotes: 21
Reputation: 1
I was facing the same issue because of my network password changed.I changed my NetExtendor login password but I have to login in my laptop with old password.
Try these steps to fix this issue:
log into the Computer with whatever password works log into vpn with whatever password works ctl-alt-del to lock the pc then use the new password to unlock it
It worked for me :-)
Thanks!
Upvotes: 0
Reputation: 115
Upvotes: 1
Reputation: 7281
I don't know why, by my applicationhost.config
file was completely missing from my C:\Users\Administrator\Documents\IISExpress\config\
folder.
Copy/pasting C:\inetpub\history\applicationhost.config
into that folder seemed to fix the problem for me.
Got the idea from here.
Upvotes: 1
Reputation: 639
You can opt to install IIS locally and edit a couple of tags on .csproj File.
Open you csproj file and go to section <VisualStudio>
then find tag <UseIIS>True</UseIIS>
it must be set as true, then go to tag: <IISUrl>
and set up with the URL address where the application will be hosted for testing:
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>False</AutoAssignPort>
<DevelopmentServerPort></DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
**<IISUrl>http://localhost/myWebSiteAppSample</IISUrl>**
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
And that is. Now you can load your project normally.
Upvotes: 20