【问题标题】:System cannot find Microsoft.ApplicationServer.Caching.Core.resources.dll when using Nuget package ServerAppFabric.Client使用 Nuget 包 ServerAppFabric.Client 时系统找不到 Microsoft.ApplicationServer.Caching.Core.resources.dll
【发布时间】:2011-12-14 07:47:03
【问题描述】:

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

【问题讨论】:

  • ServerAppFabric.Client 程序集来自哪里?这是哈瓦那人的事吗?
  • 那是nuget包,直接链接:nuget.org/packages/ServerAppFabric.Client/1.0.2912。我将在问题中列出它附带的 DLL
  • 之前没见过那个 Nuget 包,谢谢。您是否安装了 AppFabric 1.1?
  • 服务名称是AppFabricCachingService,但是不知道如何查看版本。我在 DistributedCacheAdministration 中使用 powershell 命令,没有任何命令返回版本,并且在已安装的程序和功能列表中没有看到条目。
  • 服务的可执行文件的路径是什么?如果是 1.1,它应该是 C:\Program Files\AppFabric 1.1 for Windows Server\DistributedCacheService.exe。我想知道这是否是 Nuget 包和您安装的内容之间的版本冲突,在我看来,Nuget 包是为 1.0 构建的。

标签: windows appfabric


【解决方案1】:

我对这个 NuGet 也有类似的问题。该软件包安装了四个 dll,但仅引用了其中的前两个:

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

确保您的 bin 文件夹中包含所有四个引用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-08
    • 1970-01-01
    相关资源
    最近更新 更多