简体   繁体   English

无法加载文件或程序集“ Microsoft.Data.Service”或其依赖项之一。 该系统找不到指定的文件

[英]Could not load file or assembly 'Microsoft.Data.Service' or one of its dependencies. The system cannot find the file specified

I just switched my computer and one of my project is no longer running properly and throws the error in title. 我刚切换计算机,但我的项目之一无法正常运行,并在标题中引发了错误。 (you may also find complete error message below) It is clearly looking for wrong place but at this point I'm not sure what to change. (您可能还会在下面找到完整的错误消息)显然是在寻找错误的位置,但是目前我不确定要更改什么。 Please advise. 请指教。

Some facts to keep in mind 请记住一些事实

  • I did not change no line of code in source 我没有更改源代码中的任何代码行
  • It is working fine on new production server which gets deployed by VSTS 在由VSTS部署的新生产服务器上运行正常
  • I'm using IISExpress to run it 我正在使用IISExpress来运行它
  • I'm using Visual Studio 2015 v14.0.25431.01 Update 3 我正在使用Visual Studio 2015 v14.0.25431.01更新3
  • One of the main difference from my last computer, this one has Visual Studio 2017 RC in it. 与我的上一台计算机的主要区别之一是该计算机上装有Visual Studio 2017 RC (I don't think that's causing anything but who knows) (我不认为这是什么原因,但谁知道呢)

Programs and Features 程序和特点

Following application exist 存在以下申请

  • WCF Data Services 5.6.3 Tools WCF数据服务5.6.3工具

Bin directory Bin目录

Following files exist 存在以下文件

  • Microsoft.Data.Edm.dll Microsoft.Data.Edm.dll
  • Microsoft.Data.OData.dll Microsoft.Data.OData.dll
  • Microsoft.Data.Services.Client.dll Microsoft.Data.Services.Client.dll
  • Microsoft.Data.Services.dll Microsoft.Data.Services.dll

DataService.svc (complete) DataService.svc (完整)

<%@ ServiceHost Language="C#" Factory="System.Data.Services.DataServiceHostFactory, Microsoft.Data.Services, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Service="Company.Project.Services.DataService" %>

Web.Config (partial) Web.Config (部分)

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-4.2.29.0" newVersion="4.2.29.0" />
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-5.7.0.0" newVersion="5.7.0.0" />
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-5.7.0.0" newVersion="5.7.0.0" />
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="Microsoft.Data.Services" publicKeyToken="31bf3856ad364e35" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-5.7.0.0" newVersion="5.7.0.0" />
    </dependentAssembly>
  </assemblyBinding>
</runtime>

Error Page 错误页面

Server Error in '/' Application. “ /”应用程序中的服务器错误。

Could not load file or assembly 'Microsoft.Data.Services, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 无法加载文件或程序集“ Microsoft.Data.Services,版本= 5.0.0.0,区域性=中性,PublicKeyToken = 31bf3856ad364e35”或其依赖项之一。 The system cannot find the file specified. 该系统找不到指定的文件。

Description: An unhandled exception occurred during the execution of the current web request. 说明:执行当前Web请求期间发生未处理的异常。 Please review the stack trace for more information about the error and where it originated in the code. 请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息。

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.Services, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 异常详细信息: System.IO.FileNotFoundException:无法加载文件或程序集“ Microsoft.Data.Services,Version = 5.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35”或其依赖项之一。 The system cannot find the file specified. 该系统找不到指定的文件。

Source Error: 源错误:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Data.Services, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded. 程序集加载跟踪:以下信息有助于确定为什么无法加载程序集“ Microsoft.Data.Services,版本= 5.0.0.0,区域性=中性,PublicKeyToken = 31bf3856ad364e35”。

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Data.Services, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
 (Fully-specified)
LOG: Appbase = file:///C:/Source/github/company/repository/project/HubServices/
LOG: Initial PrivatePath = C:\Source\github\company\repository\project\HubServices\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Source\github\company\repository\project\HubServices\web.config
LOG: Using host configuration file: C:\Users\user\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 5.0.0.0 redirected to 5.7.0.0.
LOG: Post-policy reference: Microsoft.Data.Services, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: The same bind was seen before, and was failed with hr = 0x80070002.

Stack Trace: 堆栈跟踪:

[FileNotFoundException: Could not load file or assembly 'Microsoft.Data.Services, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]

[FileNotFoundException: Could not load file or assembly 'Microsoft.Data.Services, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +70
   System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +40
   System.Type.GetType(String typeName, Boolean throwOnError) +34
   System.ServiceModel.Activation.ServiceParser.GetType(String typeName) +55
   System.ServiceModel.Activation.ServiceParser.GetCompiledType(Assembly compiledAssembly) +76
   System.ServiceModel.Activation.ServiceParser.CreateParseString(Assembly compiledAssembly) +38
   System.ServiceModel.Activation.ServiceBuildProvider.GetCustomString(CompilerResults results) +33
   System.Web.Compilation.BuildProvider.CreateBuildResult(CompilerResults results) +182
   System.Web.Compilation.BuildProvider.GetBuildResult(CompilerResults results) +16
   System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +10098689
   System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +294
   System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +103
   System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) +82
   System.Web.Compilation.BuildManager.GetCompiledCustomString(String virtualPath) +31
   System.ServiceModel.HostingManager.GetCompiledCustomString(String normalizedVirtualPath) +163
   System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +201
   System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +52
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +641

[ServiceActivationException: The service '/DataService.svc' cannot be activated due to an exception during compilation.  The exception message is: Could not load file or assembly 'Microsoft.Data.Services, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..]
   System.Runtime.AsyncResult.End(IAsyncResult result) +481507
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +174
   System.ServiceModel.Activation.ServiceHttpHandler.EndProcessRequest(IAsyncResult result) +11
   System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +129

I had to re-open that project, realized assembly is not in the loaded Modules . 我不得不重新打开该项目,意识到程序集不在加载的模块中 I checked the output directory which was set for bin\\{Configuration} changing it to bin solved the issue. 我检查了为bin\\{Configuration}设置的输出目录,将其更改为bin解决了该问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法加载文件或程序集“Microsoft.AspNet.TelemetryCorrelation”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Microsoft.AspNet.TelemetryCorrelation' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“Microsoft.AI.Web”或其依赖项之一。 系统找不到指定的文件 - Could not load file or assembly 'Microsoft.AI.Web' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“路径”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly "path" or one of its dependencies. The system cannot find the file specified XamlParseException:无法加载文件或程序集“ ResourceLibrary,...”或其依赖项之一。 该系统找不到指定的文件 - XamlParseException: Could not load file or assembly 'ResourceLibrary, …' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集或其依赖项之一。该系统找不到指定的文件 - Could not load file or assembly or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集或其依赖项之一。 该系统找不到指定的文件。 (不允许GAC) - Could not load file or assembly or one of its dependencies. The system cannot find the file specified. (No GAC allowed) 无法加载文件或程序集“ServiceStack”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'ServiceStack' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“Logging.SNLLoggingStandard3”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Logging.SNLLoggingStandard3' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集“Elmah”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Elmah' or one of its dependencies. The system cannot find the file specified 无法加载文件或程序集的“扩展名”或其依赖项之一。 该系统找不到指定的文件 - Could not load file or assembly 'Extensions' or one of its dependencies. The system cannot find the file specified
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM