Web 应用程序项目 [...] 被配置为使用 IIS.找不到 Web 服务器 [...]. [英] The Web Application Project [...] is configured to use IIS. The Web server [...] could not be found.

查看:31
本文介绍了Web 应用程序项目 [...] 被配置为使用 IIS.找不到 Web 服务器 [...].的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我打开解决方案时,我的解决方案文件中有一个 Web 项目不可用".当我右键单击 Web 项目并重新加载项目时,出现以下错误:

I have a web project in my solution file that is "unavailable" when I open the solution. When I right-click on the web project and reload the project, I get the following error:

<代码>Web 应用程序项目 mycompany.myapp.mywebproject 配置为使用 IIS.找不到 Web 服务器http://localhost/MyWebApp".

我没有为此 Web 应用程序手动设置虚拟目录.

I have not manually set up virtual directories for this web application.

每个同事,Visual Studio 应该提示我创建虚拟目录,但我没有收到提示.

Per colleagues, Visual Studio should prompt me to create virtual directories but I am not getting prompted.

我在我的开发机器上安装 IIS 之前安装了 VS2010.

I installed VS2010 before installing IIS on my dev machine.

这是我的开发机器设置:

Here is my development machine setup:

  • Windows 7 企业版
  • 服务包 1
  • 64 位操作系统
  • Visual Studio 2010 企业服务包 1
  • IIS 7.5 版

推荐答案

发生这种情况时,最简单的解决方案是手动创建虚拟目录.

When this happens the easiest solution is to make the virtual directory manually.

首先,您需要确保安装了正确版本的 ASP.Net 并安装了 IIS 扩展.

First of all, you need to make sure you have the right version of ASP.Net installed and that you have installed the IIS extensions.

为此,请转到 C:(Windows)Microsoft.NETFramework(dotnetver) 中的相关 .net 版本文件夹(用括号中的文件夹替换您 PC 上的正确文件夹)并运行此命令

To do this, go to the relevant .net version's folder in C:(Windows)Microsoft.NETFramework(dotnetver) (substituting the bracketed folders for the right folders on your PC) and run this command

aspnet_regiis.exe -i

接下来一旦运行并完成,有时会运行

Next once that's run and finished, sometimes running

iisreset

来自命令行的帮助,有时您不需要.

from the command line helps, sometimes you don't need to.

接下来,转到您的 IIS 管理器并找到您的 localhost 网站并选择添加一个文件夹.浏览到项目中包含实际 ASP.Net 项目的文件夹并添加该文件夹.

Next, go to your IIS Manager and find you localhost website and choose add a folder. Browse to the folder in your project that contains the actual ASP.Net project and add that.

最后,右键单击您添加的文件夹,您应该有一个选项,显示转换为应用程序"或创建虚拟目录"或类似内容.

Finally, right click on the folder you added and you should have an option that says 'convert to application' or 'create virtual directory' or something similar.

!!确保虚拟目录的名称为MyWebApp"!!

重新加载您的解决方案,它应该可以工作了.

Reload your solution and it should work.

请小心;这不是一个编程问题(并且不应该真正发布在这里)但是我已经发布了这个指南,因为这是一个常见问题,但是我发布的建议是通用的;我列出的命令是正确的,但您需要在 IIS 中执行的步骤可能会有所不同,这取决于您的版本和您的帐户权限.

Please be wary; this isn't a programming question (and shouldn't really be posted here) but I've posted this guidance as it's a common problem, but the advice I've posted is generic; the commands I've listed are correct but the steps you need to do in IIS may vary, it depends on your version and your account privileges.

祝你好运!

这篇关于Web 应用程序项目 [...] 被配置为使用 IIS.找不到 Web 服务器 [...].的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆