I get the following runtime erorr while spawning an azure worker job.
System.IO.FileLoadException: 'Could not load file or assembly 'Microsoft.ServiceBus, Version=22.214.171.124, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'
has anyone faced same issues?
The error message tells us that the service bus assembly is missing when deployed your project. Please check your property of your assembly. Make sure that the value of
Copy Local is
true before deployment.
Microsoft.ServiceBus.dll needs to packaged with your project because it is not available by default in Azure.
You are most likely getting your .dll reference from your local computer. From the GAC maybe, probably. Or hard coded to a long full-file-name-path.
You should consider using nuget to pull down your dependencies.
This will allow your references to be in a relative path, and will work on your build-machine if/when you get one.
This below article will help you bridge the gap with Visual Studio and Nuget:
Quickstart: Install and use a package in Visual Studio (Windows only)
07/23/2018 3 minutes to read +1 NuGet packages contain reusable code that other developers make available to you for use in your projects. See What is NuGet? for background. Packages are installed into a Visual Studio project using the NuGet Package Manager or the Package Manager Console. This article demonstrates the process using the popular Newtonsoft.Json package and a Windows Presentation Foundation (WPF) project. The same process applies to any other .NET or .NET Core project.
User contributions licensed under CC BY-SA 3.0