Azure存储仿真程序未能为Azure SDK 2.4初始化

Azure存储仿真程序未能为Azure SDK 2.4初始化,azure,Azure,我正在学习如何使用Microsoft Azure Tools for Visual Studio在以下位置开发Azure云服务:“” 我成功地完成了以下步骤: 1.安装Azure工具。 2.创建Azure云服务 第三步是构建和调试云服务,我被困在这里。 调试时,我遇到一个错误“未能初始化Microsoft Azure存储模拟器” 我确实尝试了各种网站上提供的各种方法来初始化存储模拟器,但没有一种对我有效 当我尝试命令WAStorageEmulator.exe init时,我得到一个错误“无法创建

我正在学习如何使用Microsoft Azure Tools for Visual Studio在以下位置开发Azure云服务:“”

我成功地完成了以下步骤: 1.安装Azure工具。 2.创建Azure云服务

第三步是构建和调试云服务,我被困在这里。 调试时,我遇到一个错误“未能初始化Microsoft Azure存储模拟器”

我确实尝试了各种网站上提供的各种方法来初始化存储模拟器,但没有一种对我有效

当我尝试命令WAStorageEmulator.exe init时,我得到一个错误“无法创建数据库”


如果有任何帮助,我们将不胜感激。

我也遇到了类似的问题,听起来像是这里发布的答案之一:

这似乎更接近你所经历的


我希望这有助于

第1步:在安全模式下启动系统(电脑开机或重启后立即按F8键进入安全模式)

步骤2:在安全模式下,通过路径C:\Program Files(x86)\Microsoft SDK\Azure\Storage Emulator

步骤3:搜索WAStorageEmulator.exe-config文件

步骤4:使用记事本++(任何编辑器)编辑WAStorageEmulator.exe

步骤5:更改端口号,如上面的快照所示。 (默认情况下,端口号为10000、10001、10002)


步骤6:保存文件,以正常模式重新启动系统,然后运行程序


我希望这能有所帮助。

打开MS Azure命令提示符。键入(取决于您的本地数据库名称):

SqlLocalDb停止项目v12

SqlLocalDb删除项目v12

然后去

C:\Users(admin)\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances


我删除了其中的所有实例。然后尝试重新安装Azure存储模拟器。这对我很有效。

根据公认的答案,无需重新启动

  • 在管理模式下打开Powershell窗口
  • 输入以下命令:
    netstat-ptcp-ano | findstr:10000
  • 这将告诉您使用仿真器指定端口的进程id。 使用任务管理器详细信息中的详细信息选项卡查找进程id的关联应用程序。这通常类似于bittorrent/utorrent

  • 结束这个过程,你就完蛋了
  • 但是,如果在开发时必须运行冲突的应用程序,则可以更改模拟器使用的端口

    要更改emulator使用的端口,请在powershell中执行以下操作:

    chdir "C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator"
    .\WAStorageEmulator stop
    
    然后根据接受的答案编辑配置文件并保存它

    C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\WAStorageEmulator.exe.config
    
    你不需要在任何地方复制它。然后返回Powershell并执行以下操作:

    .\WAStorageEmulator status
    .\WAStorageEmulator start
    

    确保已安装SQL Server Express或SQL LocalDb。然后你就可以打字了

    \AzureStorageEmulator.exe init

    或者,在这种情况下:

    \WAStorageEmulator.exe init

    …它应该安装默认数据库。注意,我使用的是PowerShell语法。如果使用命令提示符,它将减去。\r部分

    与其他帖子可能暗示的相反,这并不总是港口冲突

    您可以在此处下载SQL Server Express版本:

    运行该命令时,您应该会看到如下内容:

    PS C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator> .\AzureStorageEmulator.exe init
    Windows Azure Storage Emulator 5.10.0.0 command line tool
    Empty SQL Instance. Autodetecting SQL Instance to use.
    Looking for a LocalDB Installation.
    Probing SQL Instance: '(localdb)\MSSQLLocalDB'.
    Caught exception while probing for SQL endpoint. Login failed for user 'somedomain\someguy'.
    Number of SqlErrors Reported: 1
    SqlError: System.Data.SqlClient.SqlError: Login failed for user 'somedomain\someguy'.
    Could not find a LocalDB Installation.
    Probing SQL Instance: 'localhost\SQLExpress'.
    Found SQL Instance localhost\SQLExpress.
    Creating database AzureStorageEmulatorDb510 on SQL instance 'localhost\SQLExpress'.
    
    Granting database access to user somedomain\someguy.
    Database access for user somedomain\someguy was granted.
    
    Initialization successful. The storage emulator is now ready for use.
    The storage emulator was successfully initialized and is ready to use.
    PS C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>
    

    问题在于具有权限的“(localdb)\MSSQLLocalDB”SQL服务。 最好的选择是使用以下命令, 步骤1:选择路径“C:\ProgramFiles(x86)\Microsoft SDK\Azure\Storage Emulator

    步骤2:以管理员身份打开PowerShell

    步骤3:运行PowerShell中的以下命令, “AzureStorageEmulator.exe init-server.-sqlinstance SQLEXPRESS-forcecreate” 下面是输出,

    步骤4:PowerShell中运行下面的命令来启动Emulator, “AzureStorageEmulator.exe启动” 下面是输出,

    第5步:然后检查“SQLEXPRESS数据库, 创建新数据库。

    现在您可以使用存储仿真器了。

    您不必在安全模式下启动系统,只需将原始.config文件复制粘贴到桌面,在那里进行更改,然后将其复制粘贴回Storage Emulator文件夹即可。您需要管理员权限才能执行此操作。我是在Windows7上做的。Daystate是对的。我只是复制了文件,编辑了它,然后再复制回来。然后重新启动VS 2013(无系统重新启动),它将重新开始工作。奇怪的是,在过去一周左右的时间里,我多次遇到这个问题,但我可以在重启电脑后重新启动它。不过,这次,它不再工作了。这就是为什么如果我在最后降落在这里,我会好起来的。ThanksI也面临同样的问题,我正在使用storage emulator v5.2。在此版本中没有WAStorageEmulator.exe配置文件,您必须编辑AzureStorageEmulator.exe.config文件。不需要在安全模式下运行,只需要管理员权限(您可以在记事本++中编辑它)。然后再次从VS运行它,它可以工作:)我尝试删除mdf文件,但它没有帮助我解决问题@Andres。非常感谢。这对我有用。我推荐这个解决方案。它对我有效。无需在安全模式下启动机器,只需修改配置文件并运行存储模拟器即可。
    PS C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator> .\AzureStorageEmulator.exe init
    Windows Azure Storage Emulator 5.10.0.0 command line tool
    Empty SQL Instance. Autodetecting SQL Instance to use.
    Looking for a LocalDB Installation.
    Probing SQL Instance: '(localdb)\MSSQLLocalDB'.
    Caught exception while probing for SQL endpoint. Login failed for user 'somedomain\someguy'.
    Number of SqlErrors Reported: 1
    SqlError: System.Data.SqlClient.SqlError: Login failed for user 'somedomain\someguy'.
    Could not find a LocalDB Installation.
    Probing SQL Instance: 'localhost\SQLExpress'.
    Found SQL Instance localhost\SQLExpress.
    Creating database AzureStorageEmulatorDb510 on SQL instance 'localhost\SQLExpress'.
    
    Granting database access to user somedomain\someguy.
    Database access for user somedomain\someguy was granted.
    
    Initialization successful. The storage emulator is now ready for use.
    The storage emulator was successfully initialized and is ready to use.
    PS C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>