我刚接触Azure,并被分配了一个基于C# CosmosDB的项目。我正在尝试开发一个MVC,并将其与Azure CosmosDB集成。我得到下面的错误:
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Azure.Documents.Client, Version=1.20.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/Users/sss/source/repos/StorageAspNet/StorageAspNet/
LOG: Initial PrivatePath = C:\Users\sss\source\repos\StorageAspNet\StorageAspNet\bin
Calling assembly : Microsoft.Azure.CosmosDB.Table, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\sss\source\repos\StorageAspNet\StorageAspNet\web.config
LOG: Using host configuration file: C:\Users\sss\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.Azure.Documents.Client, Version=1.20.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Users/sss/AppData/Local/Temp/Temporary ASP.NET Files/vs/e10709d8/d578a8f8/Microsoft.Azure.Documents.Client.DLL.
LOG: Attempting download of new URL file:///C:/Users/sss/AppData/Local/Temp/Temporary ASP.NET Files/vs/e10709d8/d578a8f8/Microsoft.Azure.Documents.Client/Microsoft.Azure.Documents.Client.DLL.
LOG: Attempting download of new URL file:///C:/Users/sss/source/repos/StorageAspNet/StorageAspNet/bin/Microsoft.Azure.Documents.Client.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.但是在我安装的程序集之间有一些冲突。我不确定是什么问题,所以我已经张贴了上述日志。
我也收到了下面的警告,我认为这是我在运行应用程序时出现错误的原因。
Warning Found conflicts between different versions of "Microsoft.Azure.Documents.Client" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. StorageAspNet 发布于 2018-04-19 15:18:34
我能够通过将Microsoft.Azure.DocumentDB更新到1.20或更高版本来解决这个问题。看起来Microsoft.Azure.CosmosDB.Table的nuspec可能有问题,因为它只指定了Microsoft.Azure.DocumentDB的版本>= 1.19.0,但它确实需要一个更高的版本。对我来说,它只选择了1.19.1版本,这导致了与你看到的相同的错误。
https://stackoverflow.com/questions/49903959
复制相似问题