我已經寫在ASP.NET網站,我試圖將其部署到Windows 7的IIS - 部署ASP.NET網站和數據庫連接
我已經成功地部署了網站,並能正常工作,直到我嘗試訪問連接到數據庫的頁面。顯示以下錯誤:
'/'應用程序中的服務器錯誤。
無法打開登錄請求的數據庫「銀行」。登錄失敗。 用戶'IIS APPPOOL \ ASP.NET v4.0'登錄失敗。 描述:執行當前Web請求期間發生未處理的異常。請查看堆棧跟蹤以獲取有關該錯誤的更多信息以及源代碼的位置。
異常詳細信息:System.Data.SqlClient.SqlException:無法打開登錄請求的數據庫「銀行」。登錄失敗。 用戶'IIS APPPOOL \ ASP.NET v4.0'登錄失敗。
源錯誤: 執行當前Web請求期間生成未處理的異常。關於異常的來源和位置的信息可以使用下面的異常堆棧跟蹤來標識。
堆棧跟蹤:
[SQLEXCEPTION(0x80131904):無法打開數據庫 「銀行」 的登錄請求。登錄失敗。 用戶'IIS APPPOOL \ ASP.NET v4.0'登錄失敗。] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException異常,Boolean breakConnection)+6351920 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()+ 412 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,SqlCommand的cmdHandler,SqlDataReader的數據流,BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject stateObj)1363 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(布爾enlistOK)53 System.Data。 SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo,String newPassword,Boolean redirectedUserInstance,SqlConnection owningObject,SqlConnectionString connectionOptions,TimeoutTimer timeout)+6366878 System.Data.SqlClient.SqlInternalConnectionT ds.OpenLoginEnlist(SqlConnection擁有對象,TimeoutTimer超時,SqlConnectionString連接選項,字符串newPassword,布爾重定向用戶實例)+6366793 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity標識,SqlConnectionString connectionOptions,Object providerInfo,String newPassword,SqlConnection owningObject,Boolean重定向用戶實例)+352 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions選項,對象poolGroupProviderInfo,池類DBConnectionPool,的DbConnection owningConnection)831 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(的DbConnection owningConnection,池類DBConnectionPool,DbConnectionOptions選項)+49 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)+6368598 System.Data.Pr oviderBase.DbConnectionPool.UserCreateRequest(的DbConnection owningObject)78 System.Data.ProviderBase.DbConnectionPool.GetConnection(的DbConnection owningObject)2194 System.Data.ProviderBase.DbConnectionFactory.GetConnection(的DbConnection owningConnection)89 System.Data.ProviderBase。 DbConnectionClosed.OpenConnection(DbConnection outerConnection,DbConnectionFactory connectionFactory)+6372110 System.Data.SqlClient.SqlConnection.Open()+300 SQL_Injection_Vulnerable.LogIn。ImageButton_LogIn_Click(Object sender,ImageClickEventArgs e)位於C:\ Users \ Matthew \ Desktop \ Thesis \ Code \ Vulnerability 6 - 信息泄露\版本16 - 更改連接字符串\ Info_Leakage_Vulnerable \ Info_Leakage_Vulnerable \ LogIn.aspx.cs:51 System.Web .ui.WebControls.ImageButton.OnClick(ImageClickEventArgs e)+187 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument)+165 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,Boolean includeStagesAfterAsyncPoint)+ 3707
版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET版本:4.0.30319.272
我用下面的方法來部署IIS網站:
- 轉到桌面/代碼/ Info_Leakage_Vulnerable
- 複製Info_Leakage_Vulnerable
- 轉到C:/的Inetpub/wwwroot文件
- 粘貼INETMGR 0123有
- 打開開始菜單
- 類型的文件夾
- 開回家-PC /網站
- 網站上單擊鼠標右鍵,然後點擊添加網站
網站名稱= Info_Leakage_Vulnerable
應用程序池= ASP.NET版本4
物理路徑= C中的文件夾路徑:/ inetpub/wwwroot/Info_Leakage_Vulnerable
Port = 1000
- 上Info_Leakage_Vulnerable在網站菜單中單擊鼠標右鍵,點擊切換到內容視圖上HomePage.aspx
- 點擊和點擊瀏覽
網站完全在Visual Studio中。從IIS運行網站時遇到的問題。我該如何解決數據庫連接問題?謝謝
我在SQL Server中執行了一行代碼。我試圖部署該網站,但我面臨同樣的問題。我會嘗試你上面列出的新步驟。 – Matthew
我試過上面的步驟,但由於某種原因或其他它仍然不會工作:s – Matthew
是的,我做到了。實際上,它出現在登錄文件夾中。我得到的錯誤是完全一樣的,除了用戶已從apppool更改爲'NT AUTHORITY \ NETWORK SERVICE'。 – Matthew