我在一个应用程序中包含了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)对如何帮助它找到资源DLL有什么想法吗?它不在nuget包里。
我使用的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发布于 2017-01-03 17:55:04
我对这个NuGet也有类似的问题。该包安装了四个dll,但仅引用了前两个dll:

MSBuild复制了bin文件夹中的另外两个引用,可能是通过检测上面两个文件夹中使用的类型,但其他一些部署工具不能。
确保您的bin文件夹中包含了所有四个引用。
https://stackoverflow.com/questions/8501008
复制相似问题