[英]web.config error
我正在嘗試將我的網站部署到我的主機,並在我的網站上收到以下錯誤消息。 配置文件:
無法讀取配置節'connectionStrings',因為它缺少節聲明
在System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage消息,WebResponse響應,Stream responseStream,布爾asyncCall)處於System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName,Object []參數)
connectionstring聲明如下:
<connectionStrings configSource="ConnectionStrings.config"/>
並在相應的connectionStrings.config文件中:
<connectionStrings>
<add name="" connectionString="Provider=SQLOLEDB; Data Source=dataSource;Initial Catalog=databaseName;User Id=userName;Password=password;Integrated Security=True;Persist Security Info=False;Connect Timeout=120" />
</connectionStrings>
web.config文件未加密,我不知所措
如果您的應用程序配置為使用.NET Framework 1.1運行,但是您為.NET Framework 2.0(或更高版本)開發了它,則web.config文件是不同的,並且具有此“connectionStrings”XML節點。
您應該在Internet Information Server中檢查站點的配置。 右鍵單擊網站,選擇屬性並查看ASP.NET選項卡。 如果選擇1.1,則將其更改為2.0。
希望這可以幫助。
只需刪除部分聲明並添加“providerName = System.Data.SqlClient”(例如)屬性
您的web.config是否包含標簽? 它里面有標簽嗎? 如果是這樣,以下內容可能對您有用 : http : //foxsys.blogspot.com/2009/05/iis7-errorgotcha-webconfig.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.