gpt4 book ai didi

asp.net - Azure 和 Aspnet_regsql.exe

转载 作者:行者123 更新时间:2023-12-02 07:32:23 26 4
gpt4 key购买 nike

Possible Duplicate:
Migrating ASP.NET Membership Database to SQL Azure

我最近向 Microsoft Azure 发布了一个 MVC3 应用程序,在一些帮助下我能够让我的 EF 数据库正常工作。但是,我遇到了一个问题,即我使用的默认角色和用户,而不是为管理员登录等创建自己的表。

我找到了要求您运行 Aspnet_regsql.exe 的答案,我确实这样做了,但收到以下错误:

Setup failed.

Exception:
An error occurred during the execution of the SQL file 'InstallCommon.sql'.
The SQL error number is 40508 and the SqlException message is: USE statement
is not supported to switch between databases. Use a new connection to connect
to a different Database.

我搜索了此错误,发现这不适用于 Windows Azure。这让我看到了这篇文章,它有助于解释原因并给出解决方案:http://thinkfirstcodelater.com/blog/?p=637

它告诉我下载以下文件并运行它们。 http://archive.msdn.microsoft.com/KB2006191/Release/ProjectReleases.aspx?ReleaseId=3539

问题是,当我运行该文件夹中的应用程序时,命令行出现然后消失。我看不到它说什么,只知道它失败了。我该如何解决这个问题?

原来的问题源于此:

Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

当我尝试登录自己的网站时会显示该信息。

任何帮助将不胜感激。谢谢!

最佳答案

您需要适用于 SQL Azure 的版本,因为就像错误已经指出的那样,SQL Azure 不支持 USE 语句: KB2006191 - Updated ASP.NET scripts for use with SQL Azure

注意: How do i run aspnet_regsql on sql azure? 的重复项

关于asp.net - Azure 和 Aspnet_regsql.exe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11194580/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com