添加VS 2015 SDK后,Azure存储模拟器失败

Gre*_*low 31 azure azure-storage

我已经安装了Azure SDK 2.5和Tools for VS2013并且工作了很长时间.今天我安装了适用于VS2015的SDK和工具,现在我的Azure存储模拟器无法启动.在第一次尝试启动它时,我得到了一个SqlException:

Unhandled Exception: System.Data.SqlClient.SqlException:
An error occurred while processing the log for database If possible,
restore from backup. If a backup is not available, it might be
necessary to rebuild the log.
Run Code Online (Sandbox Code Playgroud)

重新启动机器后,我得到一个较小的错误:

C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>WAStorageEmulator start Windows Azure Storage Emulator
3.4.0.0 command line tool Error: The storage emulator needs to be initialized. Please run the 'init' command.
Run Code Online (Sandbox Code Playgroud)

但是运行init不起作用:

C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>WAStorageEmulator init Windows Azure Storage Emulator 3.4.0.0 command line tool Error: Cannot create database.
Run Code Online (Sandbox Code Playgroud)

从-inprocess开始说我的登录失败了.我是机器上的管理员所以这很奇怪.

C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>WAStorageEmulator start -inprocess
Windows Azure Storage Emulator 3.4.0.0 command line tool
Cannot open database "WAStorageEmulatorDb34" requested by the login. The login failed.
Login failed for user 'DOMAIN\genslow'.
3/24/2015 10:00:57 AM [Info] Starting Service: Blob
3/24/2015 10:00:57 AM [Verbose_debug] [Nephos.Storage] { Initialize
3/24/2015 10:00:57 AM [Info_debug] Loading config Param NephosAllowPathStyleUris (Allow path-style URIs) read: true
3/24/2015 10:00:57 AM [Info_debug] Successfully loaded NephosAllowPathStyleUris: True
3/24/2015 10:00:57 AM [Info_debug] Loading config Param NephosIncludeInternalDetailsInErrorResponses (Include internal details in error responses) read: false
3/24/2015 10:00:57 AM [Info_debug] Successfully loaded NephosIncludeInternalDetailsInErrorResponses: False
3/24/2015 10:00:57 AM [Info_debug] Loading config Param StampName (Stamp Name) read: StorageEmulator
3/24/2015 10:00:57 AM [Info_debug] BlockBlob: Load Interval failed. IsGC: True, Exception    at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
   at Microsoft.WindowsAzure.DevelopmentStorage.Store.BlockBlobGarbageCollector.GetTimerIntervalOrDefault(Boolean isGC)
3/24/2015 10:00:57 AM [Info_debug] BlockBlob: Load Interval failed. IsGC: False, Exception    at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
   at Microsoft.WindowsAzure.DevelopmentStorage.Store.BlockBlobGarbageCollector.GetTimerIntervalOrDefault(Boolean isGC)
3/24/2015 10:00:57 AM [Verbose_debug] [Nephos.Storage] } Initialize
Service Status: Blob http://127.0.0.1:10000/ True
3/24/2015 10:00:57 AM [Info] Starting Service: Queue
3/24/2015 10:00:57 AM [Verbose_debug] [Nephos.Queue] { Initialize
3/24/2015 10:00:57 AM [Info_debug] Loading config Param NephosAllowPathStyleUris (Allow path-style URIs) read: true
3/24/2015 10:00:57 AM [Info_debug] Successfully loaded NephosAllowPathStyleUris: True
3/24/2015 10:00:57 AM [Info_debug] Loading config Param NephosIncludeInternalDetailsInErrorResponses (Include internal details in error responses) read: false
3/24/2015 10:00:57 AM [Info_debug] Successfully loaded NephosIncludeInternalDetailsInErrorResponses: False
3/24/2015 10:00:57 AM [Info_debug] Loading config Param StampName (Stamp Name) read: StorageEmulator
3/24/2015 10:00:57 AM [Verbose_debug] [DevelopmentStorage.Queue] } Initialize
Service Status: Queue http://127.0.0.1:10001/ True
3/24/2015 10:00:57 AM [Info] Starting Service: Table
3/24/2015 10:00:57 AM [Verbose_debug] [Nephos.Table] { Initialize
3/24/2015 10:00:57 AM [Info_debug] Loading config Param NephosAllowPathStyleUris (Allow path-style URIs) read: true
3/24/2015 10:00:57 AM [Info_debug] Successfully loaded NephosAllowPathStyleUris: True
3/24/2015 10:00:57 AM [Info_debug] Loading config Param NephosIncludeInternalDetailsInErrorResponses (Include internal details in error responses) read: false
3/24/2015 10:00:57 AM [Info_debug] Successfully loaded NephosIncludeInternalDetailsInErrorResponses: False
3/24/2015 10:00:57 AM [Info_debug] Loading config Param StampName (Stamp Name) read: StorageEmulator
3/24/2015 10:00:57 AM [Info] NOT using custom threadpool for blocking calls
Service Status: Table http://127.0.0.1:10002/ True
Run Code Online (Sandbox Code Playgroud)

使用-inprocess运行init提供以下详细信息:

C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>WAStorageEmulator init -inprocess
Windows Azure Storage Emulator 3.4.0.0 command line tool
Added reservation for http://127.0.0.1:10000/ in user account DOMAIN\genslow.
Added reservation for http://127.0.0.1:10001/ in user account DOMAIN\genslow.
Added reservation for http://127.0.0.1:10002/ in user account DOMAIN\genslow.

Found SQL Instance (localdb)\MSSQLLocalDB.

Creating database WAStorageEmulatorDb34 on SQL instance '(localdb)\MSSQLLocalDB'.
Cannot create database 'WAStorageEmulatorDb34' : Database 'WAStorageEmulatorDb34' already exists. Choose a different database name..
One or more initialization actions have failed. Resolve these errors before attempting to run the storage emulator again.
Error: Cannot create database 'WAStorageEmulatorDb34' : Database 'WAStorageEmulatorDb34' already exists. Choose a different database name..
Run Code Online (Sandbox Code Playgroud)

那么无论如何要从中恢复还是应该卸载所有内容并重新开始?

Mic*_*SFT 82

您可以使用以下过程从涉及数据库的大多数init问题中恢复.请注意,模拟器中的所有数据当前都将丢失.

删除SQL实例:

sqllocaldb stop MSSQLLocalDB
sqllocaldb delete MSSQLLocalDB
Run Code Online (Sandbox Code Playgroud)

现在删除以下数据库文件:

%USERPROFILE%\AzureStorageEmulatorDb*.mdf
%USERPROFILE%\AzureStorageEmulatorDb*.ldf
Run Code Online (Sandbox Code Playgroud)

最后,重新创建sql实例:

sqllocaldb start MSSQLLocalDB
Run Code Online (Sandbox Code Playgroud)

然后重试模拟器init.

  • 谢谢,这对我来说也很完美. (2认同)

NiL*_*NiL 6

我试图清理localdb,但没有成功,因此任何人在使用本地db运行存储模拟器时都遇到问题,可以从此命令中受益,以便在SqlExpress上运行它。

命令: AzureStorageEmulator.exe init -server . -sqlinstance SQLEXPRESS -forcecreate