使用Nuget包ServerAppFabric.Client时,系统找不到Microsoft.ApplicationServer.Caching.Core.resources.dll

时间:2011-12-14 07:47:04

标签: windows appfabric

我在应用程序中包含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

1 个答案:

答案 0 :(得分:0)

我对这个NuGet有类似的问题。该软件包安装了四个dll,但只引用了前两个: enter image description here

MSBuild复制bin文件夹中的其他两个引用,也许通过检测它们中的两个类型在上面使用,但是其他一些部署工具却不能。

确保将所有四个引用都放入bin文件夹中。