试图Asp.Net Memebership数据库部署到Azure的SQL [英] Trying to deploy Asp.Net Memebership database to SQL Azure

查看:141
本文介绍了试图Asp.Net Memebership数据库部署到Azure的SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图让ASP.net成员船proveider与在SQL Azure中托管我DATABSE其余工作。我已经对数据库运行相应的SQL Azure的具体脚本来进行设置。这些脚本可以从微软在这里: http://archive.msdn.microsoft.com/KB2006191

I've been trying to get the ASP.net member ship proveider to work with the rest of my databse which is hosted in SQL Azure. I've run the appropriate SQL Azure specific scripts against the database to set it up. The scripts are available from Microsoft here: http://archive.msdn.microsoft.com/KB2006191

不过,每次我使用Visual Studio 10在调试模式下运行我的网站,我收到以下错误:

However, everytime I run my site in debug mode using Visual Studio 10, I get the following error:

在执行过程中出现错误
  SQL文件InstallCommon.sql'的。
  SQL错误号为5123和
  SQLEXCEPTION消息是:创建文件
  遇到操作系统错误
  5(没有这个文本检索
  错误。原因:15105)试图
  打开或创建物理文件
  C:\\用户\\罗伯特\\文档\\ Visual
  工作室
  2010 \\ PROJECTS \\ FLYINGSHAKESTORE \\ MVCMUSICSTORE \\ APP_DATA \\ ASPNETDB_TMP.MDF。
  CREATE DATABASE失败。某些文件
  上市名称无法创建。
  检查相关的错误。创建
  ASPNETDB_74b63e50f61642dc8316048e24c7e499
  数据库...

An error occurred during the execution of the SQL file 'InstallCommon.sql'. The SQL error number is 5123 and the SqlException message is: CREATE FILE encountered operating system error 5(failed to retrieve text for this error. Reason: 15105) while attempting to open or create the physical file 'C:\USERS\ROBERTO\DOCUMENTS\VISUAL STUDIO 2010\PROJECTS\FLYINGSHAKESTORE\MVCMUSICSTORE\APP_DATA\ASPNETDB_TMP.MDF'. CREATE DATABASE failed. Some file names listed could not be created. Check related errors. Creating the ASPNETDB_74b63e50f61642dc8316048e24c7e499 database...

其他所有对数据库的访问完美的作品。因此,它不是我的连接字符串。

All other access to the database works perfectly. So its not my connection string.

我认为,当成员资格提供第一次调用,ASP.Net是改掉附加一个新的Memberhship数据库SQLAzure(它不能反正),因为它认为不存在。我不知道如何关闭该行为。

I think that when the membership provider is first called, ASP.Net is trys to attach a new Memberhship database to SQLAzure (which it can't anyway) because it thinks that one does not exist. I've no idea how to turn this behavior off.

任何人都知道我能做些什么?

Anyone know what I can do?

感谢。

罗伯托

推荐答案

谢谢你们。

一些实验后,这是我想出了:

After some experimentation, this is what I came up with:

<roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
        <providers>
            <clear/>
            <add name="AspNetSqlRoleProvider" connectionStringName="..." type="System.Web.Security.SqlRoleProvider, System.Web, Version=4.0.0.0, Culture=neutral...."/>
        </providers>
    </roleManager>
    <membership>
        <providers>
            <clear/>
            <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider.... connectionStringName=""..../>
        </providers>
    </membership>
    <profile>
        <providers>
            <clear/>
            <add name="AspNetSqlProfileProvider" connectionStringName="" type="System.Web.Profile.SqlProfileProvider..../>
        </providers>
    </profile>

这似乎很好地工作。它清除,然后再添加提供商正确的连接字符串。

This seems to work perfectly. It clears then re-adds the providers with the correct connection string.

您已经对数据库运行正确的SQL脚本此依赖。你可以在这里得到他们: http://support.microsoft.com/kb/2006191

This is dependent on you having run the correct SQL Scripts against the database. You can get them here: http://support.microsoft.com/kb/2006191

这篇关于试图Asp.Net Memebership数据库部署到Azure的SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆