我是C#的新手,并被分配了一个基于Azure 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
答案 0 :(得分:0)
我可以通过将Microsoft.Azure.DocumentDB
更新为版本1.20
或更高版本来解决此问题。看起来Microsoft.Azure.CosmosDB.Table
的nuspec可能存在问题,因为它只为1.19.0
指定版本> = Microsoft.Azure.DocumentDB
,但它确实需要更高版本。对我而言,它只选择版本1.19.1
,导致出现与您所看到的相同的错误。