我最近遇到了一个错误,试图用IIS托管我的asp.net站点。我找到了一个很多人信誓旦旦的解决办法。

解决方案: 对文件夹中的文件添加具有读权限的IIS_IUSRS 修改IIS认证方式为BasicAuthentication 刷新网站。会有用的

(http://vivekthangaswamy.blogspot.com/2009/07/aspnet-website-cannot-read.html)

我在我的网里加了什么?配置文件?我以前从来没编辑过。以下是其当前内容:

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
    <connectionStrings>
  <add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True"
   providerName="System.Data.SqlClient" />
 </connectionStrings>
 <system.web>
  <compilation debug="true" strict="false" explicit="true" targetFramework="4.0"/>
    </system.web>
</configuration>

我的错误是:

配置错误:由于权限不足,无法读取配置文件 配置文件:\?\ C: \用户* * * * *网站视觉Studio2010 \ \文件\ \ PointsForTime \ web . config


当前回答

我在localhost/MyApp上运行一个网站,通过Visual Studio自己创建的虚拟目录构建和运行。

我的“解决方案”是删除虚拟目录,让Visual Studio重新创建它。

其他回答

当然,这是一个权限问题。我采取了以下步骤,它对我有效。

在左上角选择你的网站或应用程序。在大多数情况下,它将在默认网站。 在IIS管理器7或以上版本的右上角单击“基本设置”。 单击连接为按钮。 使用“特定用户”,点击设置按钮。 输入用户名和密码。像域\用户名。对我来说就像 ABC\rrajkumar输入密码。 重启IIS,浏览你的网站。现在应该可以了。

在虚拟应用程序中遇到此问题。所有权限都设置好了。 IIS_IUSRS, AppPoolIdentity,然后给Everyone完全的访问权。毫无效果。重新启动了应用程序,站点和IIS,但是不行。

删除虚拟应用程序并重新添加它,然后它开始工作。

真希望我知道是什么解决了这个问题。

将流程模型标识更改为LocalSystem为我解决了这个问题。如果右键单击应用程序池并选择“高级设置”,就可以找到这个设置。我正在运行iis7.5。

当IIS应用程序有一个物理路径包含正斜杠/而不是反斜杠\的虚拟目录时,我们就遇到了这种情况。这是在我们的持续交付过程中使用IIS的powershell管理API意外完成的。

错误配置示例- applicationHost.config . Config

<application path="/MySite/MyService" applicationPool="MyAppPool" enabledProtocols="http">
    <virtualDirectory path="/" physicalPath="C:\inetpub\MySite/MyService" />
</application>

确保physicalPath属性不包含正斜杠/,只包含反斜杠\

- applicationHost.config . Config

<application path="/MySite/MyService" applicationPool="MyAppPool" enabledProtocols="http">
    <virtualDirectory path="/" physicalPath="C:\inetpub\MySite\MyService" />
</application>

我尝试了以前的大部分建议,但都没有用。我无法重新加载网站,所以我编辑了.csproj文件并更改了端口号,它立即工作了:

 <WebProjectProperties>
      <UseIIS>True</UseIIS>
      <AutoAssignPort>True</AutoAssignPort>
      <DevelopmentServerPort>**4000**</DevelopmentServerPort>
      <DevelopmentServerVPath>/</DevelopmentServerVPath>
      <IISUrl>http://localhost:**4000**/</IISUrl>
      <NTLMAuthentication>False</NTLMAuthentication>
      <UseCustomServer>False</UseCustomServer>
      <CustomServerUrl>
      </CustomServerUrl>
      <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
    </WebProjectProperties>

编辑.csproj文件