我最近在try 使用IIS托管我的ASP.NET站点时遇到错误.我找到了一个许多人都信以为真的解决方案.
解决方案:
- 添加对文件夹中的文件具有读取权限的IIS_IUSR
- 将IIS身份验证方法更改为基本身份验证
- 刷新网站.它会起作用的
(http://vivekthangaswamy.blogspot.com/2009/07/aspnet-website-cannot-read.html)
不过,我应该向我的web.config文件中添加什么呢?我以前从来没有编辑过它.以下是它目前的内容:
<?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>
我的错误是:
Config Error: Cannot read configuration file due to insufficient permissions
Config File: \?\C:\Users*****\Documents\Visual Studio2010\WebSites\PointsForTime\web.config