[英]Could not load file or assembly 'Microsoft.Azure.CosmosDB.BulkImport, Version=2.0.0.0
At the runtime, I keep running into this issue: 在运行时,我一直遇到这个问题:
Could not load file or assembly 'Microsoft.Azure.CosmosDB.BulkImport, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 无法加载文件或程序集“ Microsoft.Azure.CosmosDB.BulkImport,版本= 2.0.0.0,文化=中性,PublicKeyToken = 31bf3856ad364e35”或其依赖项之一。
I believe BulkImport comes from the BulkExecutor package, and I can find BulkExecutor package in packages.config
: 我相信BulkImport来自BulkExecutor包,我可以在packages.config
找到BulkExecutor包:
<package id="Microsoft.Azure.CosmosDB.BulkExecutor" version="1.1.0" targetFramework="net462" />
But I cannot find the Microsoft.Azure.CosmosDB.BulkImport
mentioned in neither packages.config
nor app.config
. 但是我找不到packages.config
和app.config
中都提到的Microsoft.Azure.CosmosDB.BulkImport
。
I can, however, find Microsoft.Azure.CosmosDB.BulkImport.dll
in \\src\\packages\\Microsoft.Azure.CosmosDB.BulkExecutor.1.1.0\\lib\\net451\\
但是,我可以在\\src\\packages\\Microsoft.Azure.CosmosDB.BulkExecutor.1.1.0\\lib\\net451\\
找到Microsoft.Azure.CosmosDB.BulkImport.dll
\\src\\packages\\Microsoft.Azure.CosmosDB.BulkExecutor.1.1.0\\lib\\net451\\
and this is referenced in .csproj
file. 这在.csproj
文件中引用。
I tried clearing the bin folder, clean/build project, uninstalling and reinstalling BulkExecutor library, rebooting Visual Studio 2015, but did not work. 我尝试清除bin文件夹,清理/构建项目,卸载并重新安装BulkExecutor库,重新启动Visual Studio 2015,但是没有用。
I'm using VS 2015, Microsoft.Azure.CosmosDB.BulkExecutor v.1.1.0, .NET Framework v.4.6.2, Microsoft.Azure.DocumentDB v.2.0.0 and Newtonsoft.Json v.10.0.2. 我正在使用VS 2015,Microsoft.Azure.CosmosDB.BulkExecutor v.1.1.0,.NET Framework v.4.6.2,Microsoft.Azure.DocumentDB v.2.0.0和Newtonsoft.Json v.10.0.2。
But I cannot find the Microsoft.Azure.CosmosDB.BulkImport mentioned in neither packages.config nor app.config. 但是我找不到在packages.config和app.config中都提到的Microsoft.Azure.CosmosDB.BulkImport。
Download the nuget package , rename it to microsoft.azure.cosmosdb.bulkexecutor.1.1.0.zip
then you can check the content. 下载nuget软件包 ,将其重命名为microsoft.azure.cosmosdb.bulkexecutor.1.1.0.zip
然后可以检查其内容。
You'll find the Microsoft.Azure.CosmosDB.BulkImport.dll
is part of the Microsoft.Azure.CosmosDB.BulkExecutor
nuget package. 您会发现Microsoft.Azure.CosmosDB.BulkImport.dll
是Microsoft.Azure.CosmosDB.BulkExecutor
nuget包的一部分。 When you reference the Microsoft.Azure.CosmosDB.BulkExecutor
package in packages.config
file, you're actually referencing the Microsoft.Azure.CosmosDB.BulkImport.dll
. 当您在packages.config
文件中引用Microsoft.Azure.CosmosDB.BulkExecutor
包时,您实际上是在引用Microsoft.Azure.CosmosDB.BulkImport.dll
。
And as I know, the normal Hintpath for packages.config
format in xx.csproj
should be something like: 据我所知,xx.csproj中packages.config
格式的xx.csproj
应该类似于:
<HintPath>..\packages\Microsoft.Azure.CosmosDB.BulkExecutor.1.1.0\lib\net451\Microsoft.Azure.CosmosDB.BulkImport.dll</HintPath>
At the runtime, I keep running into this issue: 在运行时,我一直遇到这个问题:
So the compile and build succeeded, this issue only occur in runtime? 那么编译和构建成功了,这个问题只发生在运行时吗? If so, please check whether the Microsoft.Azure.CosmosDB.BulkImport.dll
is in your output folder.(Usually bin folder). 如果是这样,请检查Microsoft.Azure.CosmosDB.BulkImport.dll
是否在您的输出文件夹中(通常是bin文件夹)。
For your error message, maybe your assembly can't find the Microsoft.Azure.CosmosDB.BulkImport.dll
it referenced if the assembly wasn't copied to output folder.You can click the Microsoft.Azure.CosmosDB.BulkImport.dll
in Solution Explorer
, then set Copy Local to true in Properties Window
. 对于您的错误信息,也许你的装配找不到Microsoft.Azure.CosmosDB.BulkImport.dll
如果大会没有被复制到输出folder.You可以点击它引用Microsoft.Azure.CosmosDB.BulkImport.dll
的Solution Explorer
,然后在“ Properties Window
中将“本地复制”设置为true。
If the issue persists though the Microsoft.Azure.CosmosDB.BulkImport.dll
and your assembly or executable are in same folder, maybe you have a similar situation like this issue . 如果通过Microsoft.Azure.CosmosDB.BulkImport.dll
和您的程序集或可执行文件在同一文件夹中仍然存在该问题,则可能出现类似此问题的情况 。 The issue could result from your code, it'll be better if you could share some simple code in your question to reproduce it. 这个问题可能是由您的代码引起的,如果您可以在问题中共享一些简单的代码来重现它,那就更好了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.