Creating a virtual directory failed with the error

2019-02-01 15:18发布

I can't solve this problem

enter image description here

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.

11条回答
Explosion°爆炸
2楼-- · 2019-02-01 16:00

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.

查看更多
贪生不怕死
3楼-- · 2019-02-01 16:04

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!

查看更多
仙女界的扛把子
4楼-- · 2019-02-01 16:04

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)

查看更多
手持菜刀,她持情操
5楼-- · 2019-02-01 16:06

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.

查看更多
淡お忘
6楼-- · 2019-02-01 16:06

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.

查看更多
成全新的幸福
7楼-- · 2019-02-01 16:08

I was having same issue. I just deleted a folder named .vs in the project directory and it worked for me.

查看更多
登录 后发表回答