日期:2014-05-18  浏览次数:20403 次

WIN7 IIS问题,VS2008运行程序出错。如果在IIS中没有将虚拟目录Web.Config录配置为应用程序,导致错误。
目前主要问题就是 虚拟目录的建立,这个好像跟XP差别比较大。

网上找了IIS配置的过程,都按照步骤做了,配置比XP简单多了。

然后运行程序出错

在应用程序级别之外使用注册为allowDefinition='MachineToApplication'的节是错误的。如果在IIS中没有将虚拟目录Web.Config录配置为应用程序,则可能导致此错误


问题1 :IIS配置完整过程
问题2:IIS下虚拟目录的建立

我自己觉得现在的问题 就是权限上面的问题。 路径添加不进去。


这是配置好IIS 后的截图




创建的虚拟目录 好像有错误,权限添加了everyone



物理路径无法写入


测试错误



------解决方案--------------------
为毛要虚拟目录
------解决方案--------------------
Web.Config只能用在asp.net应用程序中,虚拟目录并不一定是 应用程序。

如果想创建应用程序,执行下面的步骤

Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7).

In the Connections pane, expand the Sites node.

Right-click the site for which you want to create an application, and click Add Application.

In the Alias text box, type a value for the application URL, such as marketing. This value is used to access the application in a URL.

Click Select if you want to select a different application pool than the one listed in the Application pool box. In the Select Application Pool dialog box, select an application pool from the Application pool list and then click OK.

In the Physical path text box, type the physical path of the application's folder, or click the browse button (...) to navigate the file system to find the folder.

Optionally, click Connect as to specify credentials that have permission to access the physical path. If you do not use specific credentials, select the Application user (pass-thru authentication) option on the Connect As dialog box.

Optionally, click Test Settings to verify the settings that you specified for the application.

Click OK.

来自msdn:
Create a Web Application (IIS 7)
http://technet.microsoft.com/en-us/library/cc772042(WS.10).aspx
------解决方案--------------------
请确保启用了父路径 并添加asp.net用户 来执行应用程序 我没用过虚拟目录 你试下
------解决方案--------------------
这是中文的,好像就是翻译

1. 打开 IIS 管理器。
  2. 在"连接"窗格中,展开"网站"节点。
  3. 右键单击您要为其创建应用程序的站点,然后单击"添加应用程序"。
  4. 在"别名"框中,为应用程序 URL 键入一个值,如 marketing。此值用于访问 URL 中的应用程序。
  5. 如果要选择其他应用程序池,而不是"应用程序池"框中列出的应用程序池,请单击"选择"。在"选择应用程序池"对话框中,从"应用程序池"列表中选择一个应用程序池,然后单击"确定"。
  6. 在"物理路径"框中,键入应用程序所在文件夹的物理路径,或者单击浏览按钮 (...) 并通过在文件系统中导航来找到该文件夹。
  7. 您也可以单击"连接为"以指定具有物理路径访问权限的凭据。如果不使用特定的凭据,请在"连接为"对话框中选择"应用程序用户(传递式身份验证)"选项。
  8. 还可以单击"测试设置"验证您为应用程序指定的设置。
  9. 单击"确定"。

来自:
http://server.it168.com/a2008/0921/205/000000205734.shtml