Creating a virtual directory failed with the error

后端 未结 16 2046
情歌与酒
情歌与酒 2020-12-24 04:23

I can\'t solve this problem

\"enter

I suggest I have to change c:\\Windo

相关标签:
16条回答
  • 2020-12-24 04:54
    1. Turn on windows features "Internet Information Services" in control panel.
    2. Open ".csproj" file and find
    3. Modify this line based on your requirements. http://localhost:777/
    4. Open the project/solution now
    5. If failed to load again, just right click the solution and select "Reload Project".
    0 讨论(0)
  • 2020-12-24 04:55

    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.

    0 讨论(0)
  • 2020-12-24 04:57
    • Tried several approaches mentioned in the answers, but what finally worked for me was swapping the <IISUrl> of .csproj with <CustomServerUrl>.

    Edit :

    • The above didn't solve the root cause of the issue for me. However, If you've done a windows update recently, perhaps it might be the reason that's causing the issue. Try executing 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.

    0 讨论(0)
  • 2020-12-24 05:00

    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.

    0 讨论(0)
  • 2020-12-24 05: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.

    0 讨论(0)
  • 2020-12-24 05:01

    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)

    0 讨论(0)
提交回复
热议问题