gpt4 book ai didi

azure - 无法使用 StorageClient 1.7.1 运行 Azure 项目

转载 作者:行者123 更新时间:2023-12-03 00:34:06 27 4
gpt4 key购买 nike

我尝试在 VS2012 中运行包含三个项目的 Azure 解决方案:

  1. InSysDashboard(网络角色)
  2. InSysService(网络角色)
  3. InSysWatcher(辅助角色)

在添加 3. 之前,1. 和 2. 构建并部署得很好。 3. 自己构建得很好并且部署正常(但这当然不好,因为角色不能单独部署,需要作为同一包的一部分部署)。

问题似乎出在我从 https://github.com/WindowsAzure/azure-sdk-for-net/tree/sdk_1.7.1 下载并编译的 Azure SDK 1.7.1 Microsoft.WindowsAzure.StorageClient 上。 。我使用此资源中的 Microsoft.WindowsAzure.StorageClient 和 Microsoft.WindowsAzure.Configuration 库,以及 VS2012 1.7 June SDK 中的 Microsoft.WindowsAzure.Diagnostics 和 Microsoft.WindowsAzure.ServiceRuntime。

包含所有三个项目的解决方案编译时没有错误。

任何项目中都没有明确引用 Microsoft.WindowsAzure.StorageClient 1.7,仅引用 1.7.1。

但是,当我尝试运行解决方案时,工作角色 (3.) 无法加载。输出窗口包含以下代码片段:

'WaIISHost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll'
'WaIISHost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.Entity\v4.0_4.0.0.0__b77a5c561934e089\System.Data.Entity.dll'
Microsoft.WindowsAzure.ServiceRuntime Information: 200 : Role entrypoint . CALLING OnStart()
Microsoft.WindowsAzure.ServiceRuntime Information: 203 : Role entrypoint . CALLING Run()
Microsoft.WindowsAzure.ServiceRuntime Information: 100 : Role environment . INITIALED RETURNED. HResult=0
'WaIISHost.exe' (Managed (v4.0.30319)): Loaded 'F:\Everything\Current_Work\Web_Apps\Azure\InSys\InSysCloud\csx\Debug\roles\InSysService\approot\bin\Microsoft.WindowsAzure.Diagnostics.dll'
Microsoft.WindowsAzure.ServiceRuntime Information: 101 : Role environment . INITIALIZED
'WaWorkerHost.exe' (Managed (v4.0.30319)): Loaded 'F:\Everything\Current_Work\Web_Apps\Azure\InSys\InSysCloud\csx\Debug\roles\InSysWatcher\approot\Microsoft.WindowsAzure.StorageClient.dll'
Microsoft.WindowsAzure.ServiceRuntime Information: 202 : Role entrypoint . COMPLETED OnStart()
The thread 'Role Initialization Thread' (0xaa4) has exited with code 0 (0x0).
Microsoft.WindowsAzure.ServiceRuntime Information: 203 : Role entrypoint . CALLING Run()
'WaWorkerHost.exe' (Managed (v4.0.30319)): Loaded 'F:\Everything\Current_Work\Web_Apps\Azure\InSys\InSysCloud\csx\Debug\roles\InSysWatcher\approot\InSysWatcher.dll', Symbols loaded.
'WaWorkerHost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll'
Microsoft.WindowsAzure.ServiceRuntime Critical: 201 : Role entrypoint could not be created:
System.TypeLoadException: Unable to load the role entry point due to the following exceptions:
-- System.IO.FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.StorageClient, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Microsoft.WindowsAzure.StorageClient, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null'

=== Pre-bind state information ===
LOG: User = BertiesExtreme\bertie
LOG: DisplayName = Microsoft.WindowsAzure.StorageClient, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///F:/Everything/Current_Work/Web_Apps/Azure/InSys/InSysCloud/csx/Debug/roles/InSysWatcher/approot
LOG: Initial PrivatePath = F:\Everything\Current_Work\Web_Apps\Azure\InSys\InSysCloud\csx\Debug\roles\InSysWatcher\approot
Calling assembly : InSysWatcher, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.


LOG: This bind starts in default load context.
LOG: Using application configuration file: F:\Everything\Current_Work\Web_Apps\Azure\InSys\InSysCloud\csx\Debug\roles\InSysWatcher\approot\InSysWatcher.dll.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///F:/Everything/Current_Work/Web_Apps/Azure/InSys/InSysCloud/csx/Debug/roles/InSysWatcher/approot/Microsoft.WindowsAzure.StorageClient.DLL.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.


-- System.IO.FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.StorageClient, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Microsoft.WindowsAzure.StorageClient, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null'

最后一项似乎表明 Microsoft.WindowsAzure.StorageClient 有问题。

如果我查看构建解决方案时生成的 CSX 文件夹,对于我找到的每个项目:

  1. Release/roles/InSysDashboard/approot/Microsoft.WindowsAzure.StorageClient.dll(即 1.7.1)
  2. Release/roles/InSysService/approot/Microsoft.WindowsAzure.StorageClient.dll(即 1.7.1)
  3. Release/roles/InSysWatcher/approot/Microsoft.WindowsAzure.StorageClient.dll(即 1.7.0)

出于某种原因,Microsoft.WindowsAzure.StorageClient.dll 版本 1.7.0 包含在辅助角色中。我检查了引用列表,它肯定包含 1.7.1 而不是 1.7.0,那么为什么包含 1.7.0 呢?我假设现阶段这就是辅助角色未运行的原因。

有什么想法吗?

更多信息:

如果我将 C:\Program Files\Microsoft SDKs\Windows Azure.NET SDK\2012-06\ref 中的 Microsoft.WindowsAzure.StorageClient.dll (1.7.0.0) 版本替换为 1.7.1.0 版本,我然后收到与 Microsoft.WindowsAzure.Diagnostics 相关的错误。

{"Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35."}

然后在内部异常中:

{"Could not load file or assembly 'Microsoft.WindowsAzure.StorageClient, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"Microsoft.WindowsAzure.StorageClient, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"}

Microsoft.WindowsAzure.Diagnostics 似乎依赖于 Microsoft.WindowsAzure.StorageClient 1.7.0.0,因此将其替换为 1.7.1.0 会导致问题。我猜依赖是硬编码的。

最佳答案

注释掉 InSysWatcher(工作角色)的 app.config 的 systems.diagnostics 部分似乎有所帮助,即解决方案现在可以部署并且似乎按预期运行。这似乎不是“正确”的方法,但在花了近 2 天的时间之后,此时“无论有效”。

关于azure - 无法使用 StorageClient 1.7.1 运行 Azure 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12451350/

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