2011-01-19 66 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