简体   繁体   English

在localhost上将网站添加到IIS

[英]Add a website to IIS on localhost

I was trying to add my ASP.NET website in IIS 7.5 on my local computer. 我试图在我的本地计算机上的IIS 7.5中添加我的ASP.NET网站。 I followed these steps in IIS Manager. 我在IIS管理器中执行了这些步骤。

  • Right-click sites>Add website and specify the physical path. 右键单击站点>添加网站并指定物理路径。 (I chose the app pool as Default app pool) (我选择应用程序池作为默认应用程序池)
  • Right-click on the WebSite just added>Manage>Browse. 右键单击刚添加的WebSite>管理>浏览。

On trying to browse the website, I am getting this error 在尝试浏览网站时,我收到此错误

The requested page cannot be accessed because the related configuration data for the page is invalid 无法访问请求的页面,因为页面的相关配置数据无效

Here's the screenshot: 这是截图:

http://i.stack.imgur.com/r7BPj.jpg

It sounds like the process your IIS App Pool is running under does not have read access to the directory you specified. 这听起来像您运行IIS App Pool的过程没有对您指定的目录的读访问权。

The IIS App Pool is probably running under Network Service or ASP .NET 4.0 account depending on the version of .NET you're using. IIS应用程序池可能在网络服务或ASP .NET 4.0帐户下运行,具体取决于您使用的.NET版本。

Try navigating to the physical directory and changing the security properties to give Network Service and ASP .NET 4.0 (if it exists on your computer) Read access. 尝试导航到物理目录并更改安全属性,以便为网络服务和ASP .NET 4.0(如果它存在于您的计算机上)提供读访问权限。

In the new website window under "Location" click on "Browse" to see the different Server options including IIS Server . 在“位置”下的新网站窗口中,单击“浏览”以查看包括IIS服务器在内的不同服务器选项。 User can select the server as IIS server instead of "File System", then the "Location" option will be "HTTP" instead of "File System". 用户可以选择服务器作为IIS服务器而不是“文件系统”,然后“位置”选项将是“HTTP”而不是“文件系统”。

  • New Website 新网站
  • Under Locations Click on "Browse" 在地点下单击“浏览”
  • Click on "Local IIS" and then select the "IIS Virtual Directory"(IIS vitual Directory which is directory created by the user while configuring IIS server) 单击“本地IIS”,然后选择“IIS虚拟目录”(IIS虚拟目录,这是用户在配置IIS服务器时创建的目录)
  • Open 打开

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM