我爲需要基本密碼保護的客戶端設置了一個簡單的預覽網站。我使用的表單身份驗證使用web.config
中指定的憑據。禁用SQL成員提供程序(ASP.Net Forms身份驗證)
一切works fine on my box(鬼才)
然而,當我部署到運行的Win2008生產網站,驗證碼試圖打開一個SQL Server數據庫(我有沒有提到什麼SQL in web.config
)。如何禁用此行爲,以便身份驗證基於我在web.config
中輸入的憑據?
在事件日誌中的異常
無法連接到SQL Server數據庫。 at System.Web.Management.SqlServices.GetSqlConnection(String server,String user,String password,Boolean trusted,String connectionString) at System.Web.Management.SqlServices.SetupApplicationServices(String server,String user,String password,Boolean trusted ,字符串的connectionString,字符串數據庫,字符串dbFileName,SqlFeatures特徵,布爾安裝) 在System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile(字符串fullFileName,字符串DATADIR,字符串的connectionString) 在System.Web.DataAccess.SqlConnectionHelper.EnsureSqlExpressDBFile(字符串連接字符串) ... at System.Data.SqlClient.SqlConnection.Open()at System.Web.Management.SqlServices.GetSqlConnection(String server,String user,String password,Boolean trusted,String connectionString)
http://my.site.com/Login.aspx?ReturnUrl=/
的web.config(相關部分)
<system.web>
<compilation targetFramework="4.0" />
<authentication mode="Forms">
<forms name="appNameAuth" path="/" loginUrl="Login.aspx" protection="All" timeout="30">
<credentials passwordFormat="SHA1">
<user name="me" password="SHA1OfMyPassword" />
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?"/>
<allow users="me" />
</authorization>
</system.web>
謝謝。這回答了我的問題以及這裏列出的「enableSimpleMembership」條目:http://stackoverflow.com/questions/12116736/aspnet-role-provider-kicking-in-and-it-shouldnt-be – Josh 2013-08-12 11:05:52
此解決方案的缺失部分從上面的鏈接(12116736)是: 在部分 –
Nigel
2013-09-02 08:20:59