windows 使用 Nuget 包 ServerAppFabric.Client 时,系统找不到 Microsoft.ApplicationServer.Caching.Core.resources.dll
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8501008/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
System cannot find Microsoft.ApplicationServer.Caching.Core.resources.dll when using Nuget package ServerAppFabric.Client
提问by Frank Schwieterman
I've included ServerAppFabric.Client.1.0.2912 in an application to do some basic cache diagnostics. When I try to use the cache API though, I get this exception:
我在应用程序中包含了 ServerAppFabric.Client.1.0.2912 以进行一些基本的缓存诊断。但是,当我尝试使用缓存 API 时,出现此异常:
Caught unhandled exception: System.TypeInitializationException: The type initializer for 'Microsoft.ApplicationServer.Caching.ConfigManager' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.ApplicationServer.Caching.Core.resources, Version=1.0.0.0, Culture=en, PublicKeyToken=31bf3856ad364e35' or one of its
dependencies. The system cannot find the file specified. ---> System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\src\Frank\Mischief\bin\Microsoft.ApplicationServer.Caching.Core.resources, Version=1.0.0.0, Culture=en, PublicKeyToken=31bf3856ad364e35.dll' or one of its dependencies. The system cannot find the file specified.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Habanero.Commands.AppFabric.CacheDirCommand.<>c__DisplayClass9.<GetResolverForPath>b__8(Object o, ResolveEventArgs args) in C:\src\Habanero\Habanero\Commands\AppFabric\CacheDirCommand.cs:line 84
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
Any thoughts on how to help it find the resource DLL? Its not in the nuget package...
关于如何帮助它找到资源 DLL 的任何想法?它不在nuget包中......
The nuget package I'm using (http://nuget.org/packages/ServerAppFabric.Client/1.0.2912) comes with the following DLLs:
我正在使用的 nuget 包 (http://nuget.org/packages/ServerAppFabric.Client/1.0.2912) 带有以下 DLL:
Microsoft.ApplicationServer.Caching.Client.dll
Microsoft.ApplicationServer.Caching.Core.dll
Microsoft.WindowsFabric.Common.dll
Microsoft.WindowsFabric.Data.Common.dll
回答by Leogiciel
I have a similar problem with this NuGet. The package installs four dlls but only references the top-two of them :
我对这个 NuGet 有类似的问题。该软件包安装了四个 dll,但只引用了其中的前两个:
MSBuild copy the two other references in the bin folder, maybe by detecting types from them are used in the two upper, but some other deployment tools can not.
MSBuild 复制bin 文件夹中的另外两个引用,也许通过检测它们的类型在两个上层中使用,但其他一些部署工具则不能。
Keep sure you have all the four references into your bin folder.
确保将所有四个引用都放入 bin 文件夹中。