2011-01-19 70 views
3

我正在從asp.net網站學習MVC 3。如何使EF代碼首先在`IIS AppPool MySiteName`下工作?

我的MVC 3應用程序已經被IIS AppPool\MySiteName下測試,效果很好。

使用SQL Server Management Studio中,我創建了一個新的帳戶IIS AppPool\MySiteName

我跟着這個教程"creating db on the fly"我如下得到了一個錯誤:

Server Error in '/' Application. 
-------------------------------------------------------------------------------- 

Cannot open database "Movies" requested by the login. The login failed. 
Login failed for user 'IIS APPPOOL\Getting Started'. 
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. 
+1

在應用程序池`Getting Started`上設置`Load User Profile = True`。完成! – xport 2011-03-03 01:03:50

回答

1

在應用程序池GettingStarted上設置Load User ProfileTrue

+0

這裏是一個很好的教程:http ://blogs.msdn.com/b/sqlexpress/archive/2011/12/09/using-localdb-with-full-iis-part-1-user-profile.aspx – Monsignor 2014-10-31 15:12:41

2

那麼這錯誤是說,用戶IIS APPPOOL \入門沒有正確的登錄憑據,或者您的用戶名或密碼不正確。爲什麼不告訴我們在連接字符串的樣子在你的web.config文件

1

下面的事情是你應該有IMO做到:

  1. 創建並配置新的應用程序池, 說AppPoolFoo ,在本地用戶帳戶的 身份運行, 說用戶1
  2. 在IIS中配置您的網站下運行 AppPoolFoo
  3. 格蘭特用戶1與 SQL Server Management Studio中

這我不清楚你是否遵循這些步驟,或有不同的情景適當的權限。

+0

@xport:您是如何在SQL Server中創建帳戶/登錄的?我終於意識到你是一個應用程序Poool身份的「虛擬」帳戶,本文可能有幫助:http://learn.iis.net/page.aspx/624/application-pool-identities/ – BrokenGlass 2011-01-24 14:07:40