2012-12-02 48 views
3

您好我剛剛嘗試在IIS上第一次運行我的應用程序fopr。 一切工作的發現,而在Visual Studio中開發,但是當我加入了應用IIS我得到這個錯誤:無法打開數據庫錯誤從IIS

Cannot open user default database. Login failed. 
    Login failed for user 'IIS APPPOOL\forum'. 

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database. 

我應該怎麼做,當我從Visual Studio運行它的網站的作品?

編輯

我做了一個痘痘更挖我設法找到了我需要setmy應用程序池標識網絡服務我這樣做,但現在我得到了另一個錯誤:

Unable to open the physical file "D:\Projects IDE\Visual Studio\MyWork\Websites\Forum\App_Data\ASPNETDB.MDF". Operating system error 5: "5(Access is denied.)". An attempt to attach an auto-named database for file D:\Projects IDE\Visual Studio\MyWork\Websites\Forum\App_Data\ASPNETDB.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

+0

用於連接數據庫的連接字符串是什麼?如果嘗試通過在Project |中選擇IIS來運行該應用程序,該怎麼辦?屬性|網? – Igor

回答

1

請檢查兩個位置 1訪問NetworkService標識(IIS應用程序池的默認設置)或此文件夾(IIS APPPOOL \ forum) 2連接字符串憑證。如果有「綜合安全」。在那裏提供特定的用戶和密碼。

0

我收到了這個非顯式錯誤,因爲我的應用程序池設置爲.NET 2.0而不是.NET 4.0負責認證的服務。通常,當框架不正確時,會顯示有關未識別的框架.dll的不同類型的錯誤,但在這種情況下不會顯示。如果發生這種情況,檢查以下內容:

  1. 價值IIS APPPOOL這是當前進程正在運行的應用程序池的名稱。在你的情況下,有一個名爲forum的AppPool。
  2. 檢查應用程序池是否正在使用正在運行的應用程序所需的已更正的管道和.NET Framework。
相關問題