web.config文件出错了!应该怎么配置啊?

ramiro 2006-04-23 12:04:18
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.web>
<authentication mode="None"/>
<appSettings>
<add key="ConnectionSqlServer" value="Data Source=Tony;Initial Catalog=northwind;User Id=sa;Password=aaa;"></add>
</appSettings >
</system.web>
</configuration>
出错信息:

行 3: <system.web>
行 4: <authentication mode="None"/>
行 5: <appSettings>
行 6: <add key="ConnectionSqlServer" value="Data Source=Tony;Initial Catalog=northwind;User Id=sa;Password=aaa;"></add>
行 7: </appSettings >
...全文
144 5 点赞 打赏 收藏 举报
写回复
5 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
songming1984 2006-04-23
<appSettings>应该写在</configuration>内
  • 打赏
  • 举报
回复
webwait 2006-04-23
<appSettings>写在<configuration>内,<system.web>外
  • 打赏
  • 举报
回复
xiaozuo2005 2006-04-23
<appSetting>
  • 打赏
  • 举报
回复
ramiro 2006-04-23
源文件: F:\MyWebSite\mywebsite\web.config 行: 5
  • 打赏
  • 举报
回复
webwait 2006-04-23
参考这个
<?xml version="1.0"?>

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<add name="Northwind" connectionString="Server=localhost;Integrated Security=True;Database=Northwind" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>

<anonymousIdentification enabled="true" />
<profile> //定义配置(profile)
<properties>
<add name="Theme" allowAnonymous="true" />
<add name="LastVisit" type="System.DateTime" allowAnonymous="true" />
</properties>
</profile>
<!--
<webParts> //定义配置(webParts)
<personalization defaultProvider="AspNetSqlPersonalizationProvider"/>
</webParts>
-->
<!--
Set compilation debug="true" to insert debugging symbols into the compiled page.
Because this affects performance, set this value to true only during development.
-->
<compilation debug="true">
<expressionBuilders>
<add expressionPrefix="Version" type="VersionExpressionBuilder"/>
</expressionBuilders>
</compilation>
<!--
The <authentication> section enables configuration of the security authentication
mode used by ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration of what to do if/when an unhandled
error occurs during the execution of a request. Specifically, it enables developers
to configure html error pages to be displayed in place of a error stack trace.
-->
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<!--
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
-->
</customErrors>
</system.web>
</configuration>
  • 打赏
  • 举报
回复
相关推荐
发帖
.NET社区
加入

5.9w+

社区成员

.NET技术交流专区
申请成为版主
帖子事件
创建了帖子
2006-04-23 12:04
社区公告
暂无公告