在Visual Studio 2017社区中打开项目/解决方案时出错

时间:2017-04-14 12:45:52

标签: c# visual-studio rest asp.net-web-api

我正在尝试在Visual Studio 2017社区上打开一个项目/解决方案,我收到了下一个错误:

enter image description here

我一直在谷歌搜索此错误,但我没有找到任何解决方案。有什么建议?

我希望能很好地解释我的问题。

更新

我在Windows7 32位的虚拟机上使用VS17。

2 个答案:

答案 0 :(得分:3)

我尝试了Andrii提出的解决方案删除applicationhost.config文件下<site>节点内的所有<sites>但在重新启动VS2017并启动我的项目后,我收到以下错误:

  

无法连接到网络服务器'IIS Express'

在配置文件中,我不得不像以下一样放回应用程序池:

<site name="MyApp" id="1">
    <application path="/" applicationPool="Clr4IntegratedAppPool"> <-- HERE
        <virtualDirectory path="/" physicalPath="C:\Git\MyApp\MyApp" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:61508:localhost" />
    </bindings>
</site>
<applicationDefaults applicationPool="Clr4IntegratedAppPool" /> <-- AND HERE

之后重新启动VS2017并重试。

此外,您可能只需查看配置文件中指定的physicalPath文件夹...确保它是可写的。有些人指出他们在加密文件夹时遇到了问题。你可以在这里找到一些其他可能的解决方案:

Creating a virtual directory failed with the error

答案 1 :(得分:1)

几周前我遇到了同样的问题。通过打开错误中提到的applicationhost.config并删除<site>下的所有<sites>节点然后重新打开VS来解决此问题。