【问题标题】:Azure and Aspnet_regsql.exe [duplicate]Azure 和 Aspnet_regsql.exe [重复]
【发布时间】:2012-06-25 17:50:14
【问题描述】:

可能重复:
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'.

当我尝试登录自己的网站时显示。

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

【问题讨论】:

    标签: asp.net asp.net-mvc-3 azure azure-sql-database


    【解决方案1】:

    您需要适用于 SQL Azure 的版本,因为正如错误所说,SQL Azure 不支持 USE 语句: KB2006191 - Updated ASP.NET scripts for use with SQL Azure

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

    【讨论】:

    • 我运行了这个,但它不起作用。我是否通过 Visual Studio 运行它?它打开命令提示符,然后立即消失。知道为什么吗?
    • 我找不到知识库文章。它已被删除。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多