如何使 EF 代码首先在“IIS AppPool\MySiteName”下工作?

发布于 2024-10-12 09:56:07 字数 806 浏览 3 评论 0原文

我正在从 asp.net 网站学习 MVC 3。

我的 MVC 3 应用程序已经在 IIS AppPool\MySiteName 下进行了测试,并且运行良好。

使用 Sql Server Management Studio,我为 IIS AppPool\MySiteName 创建了一个新帐户。

我按照本教程“动态创建数据库”,我得到一个错误,如下所示:

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. 

I am learning MVC 3 from asp.net site.

My MVC 3 application already has been tested under IIS AppPool\MySiteName and it works well.

Using Sql Server Management Studio, I created a new account for IIS AppPool\MySiteName.

I followed this tutorial "creating db on the fly" and I got an error as follows:

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. 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一个人的旅程 2024-10-19 09:56:07

该错误表明用户 IIS APPPOOL\Getting Started 没有正确的登录凭据,您的用户名或密码不正确。为什么不向我们展示 web.config 文件中的连接字符串是什么样的

Well that error is saying that the user IIS APPPOOL\Getting Started doesn't have the proper login credentials, either your username or password is incorrect. Why not show us what the connection string looks like in your web.config file

风情万种。 2024-10-19 09:56:07

在我看来,您应该做以下事情:

  1. 创建并配置一个新的AppPool,
    比如说AppPoolFoo,在
    本地用户帐户的身份,
    User1
  2. 在 IIS 中配置您的站点以运行
    AppPoolFoo
  3. 授予User1适当的权限
    SQL Server Management Studio

我不清楚您是否遵循了这些步骤,或者有不同的情况。

The following things is all you should have to do imo:

  1. Create and configure a new AppPool,
    say AppPoolFoo, running under the
    identity of a local user account,
    say User1
  2. Configure your site in IIS to run
    under AppPoolFoo
  3. Grant User1 appropriate rights with
    SQL Server Management Studio

It's unclear to me whether you followed these steps, or have a different scenario.

吾家有女初长成 2024-10-19 09:56:07

在应用程序池 GettingStarted 上将Load User Profile 设置为 True

Set Load User Profile to True on the application pool GettingStarted.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文