LinkAssemblies task failed - xamarin

Severity Code Description Project File Line Suppression State
Error The "LinkAssemblies" task failed unexpectedly.
Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata
item 'System.Void Android.Widget.TextView::SetTextAppearance(System.Int32)' (defined in 'Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null') from 'Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Android.Widget.TextView::SetTextAppearance(System.Int32)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
--- End of inner exception stack trace ---
at Xamarin.Android.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() FeedReader.Droid
I am trying to build My Xamarin.Adroid project for release. But i keep getting this error. General consensus on the web is that that my Targeting framework and minimum SDK versions have to be so and so, but I have tried them all to no avail.
Both those SDK's are installed on my machine, I also have the latest preview of Xamarin forms added.
Nothing I am trying seems to work. Any help regarding this would be greatly appreciated.
Thank you in advance.

Looks like the method Android.Widget.TextView::SetTextAppearance(System.Int32) first appeared in API23: M. You'll need to change your compile and/or target versions to point to M.

After updated xamarin version i start getting thi error. Clean project first then build it again. fixed for me. Rebuild not working.

Related

Failed to resolve Xamarin.Forms.INavigation Xamarin.Forms.NavigableElement::get_Navigation()

I have upgraded to latest Xamarin.Froms on Visual Studio 2019 Community Edition and Target Device and API to Android Q (Level 29)
While Building solution in Debug Mode, it builds successfully but when I am trying to run in Debug or release mode on device then it is giving error.
As per the error issue is in System.Void TestAppAndroid.Views.BarCodes`1/b__1_2>d::MoveNext() But I dont see any Navigation code in this view. It is only have ListView element which Binds to a static data source.
Error MSB4018: The "LinkAssemblies" task failed unexpectedly.
Mono.Linker.MarkException: Error processing method: 'System.Void TestAppAndroid.Views.BarCodes`1/b__1_2>d::MoveNext()' in assembly: 'TestAppAndroid.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve Xamarin.Forms.INavigation Xamarin.Forms.NavigableElement::get_Navigation()
at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
at Mono.Linker.Steps.MarkStep.Process()
at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() 0

Xamarin.Droid - Could not load assembly System.Web.Mvc

I saw multiples post/question about it on StackOverflow but about ASP.NET
I am getting the following:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2,2): Error: Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'System.Web.Mvc.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference, Mono.Cecil.ReaderParameters parameters) [0x00099] in /Users/builder/data/lanes/5749/9cfa7836/source/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:229
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference) [0x00000] in /Users/builder/data/lanes/5749/9cfa7836/source/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:179
at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver resolver, System.Collections.Generic.ICollection`1[T] assemblies, Mono.Cecil.AssemblyDefinition assembly, System.Boolean topLevel) [0x0015c] in <998d78d5ee6d46b491b77aff8eeaf856>:0
at Xamarin.Android.Tasks.ResolveAssemblies.Execute (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver resolver) [0x001c7] in <998d78d5ee6d46b491b77aff8eeaf856>:0 (NightLine.Droid)
Now the interesting point is that my project isn't an ASP.NET project att all x) So first, what the hell?
I did this video: https://channel9.msdn.com/Shows/XamarinShow/Snack-Pack-15-Upgrading-to-XamarinForms-to-NET-Standard
I upgrated the .NET Standard project to 2.0. My Android target is 8.0 and the compiler as well. I tried to upgrade all of my Xamarin.Android.* packages but no success...
Any idea?
Thanks

Can't compile Xamarin android project with StructureMap in release mode

Create a blank android project Blank App (Android) in Visual Studio then add the following nuget packages
NETStandard.Library 1.6.1
StructureMap 4.5.2
Now try to compile the project in release mode.
I get the following error:
Using "LinkAssemblies" task from assembly "C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Build.Tasks.dll".
Task "LinkAssemblies"
LinkAssemblies Task
UseSharedRuntime: False
MainAssembly: obj\Release\linksrc\App2.dll
OutputDirectory: obj\Release\android\assets\
OptionalDestinationDirectory:
I18nAssemblies:
LinkMode: SdkOnly
LinkSkip:
LinkDescriptions:
ResolvedAssemblies:
obj\Release\linksrc\App2.dll
obj\Release\linksrc\Java.Interop.dll
obj\Release\linksrc\Mono.Android.dll
obj\Release\linksrc\System.Core.dll
obj\Release\linksrc\System.dll
obj\Release\linksrc\System.IO.Compression.dll
obj\Release\linksrc\System.Net.Http.dll
obj\Release\linksrc\System.Xml.dll
obj\Release\linksrc\mscorlib.dll
obj\Release\linksrc\StructureMap.dll
obj\Release\linksrc\System.Runtime.Loader.dll
obj\Release\linksrc\System.Runtime.dll
obj\Release\linksrc\System.ComponentModel.Composition.dll
obj\Release\linksrc\System.Threading.dll
obj\Release\linksrc\System.Collections.dll
obj\Release\linksrc\System.Collections.Concurrent.dll
obj\Release\linksrc\System.Reflection.dll
obj\Release\linksrc\System.Diagnostics.Debug.dll
obj\Release\linksrc\System.Linq.dll
obj\Release\linksrc\System.Runtime.InteropServices.dll
obj\Release\linksrc\System.Runtime.Extensions.dll
obj\Release\linksrc\System.Reflection.Extensions.dll
obj\Release\linksrc\System.Runtime.Serialization.dll
obj\Release\linksrc\System.ServiceModel.Internals.dll
obj\Release\linksrc\Mono.Security.dll
obj\Release\linksrc\System.Resources.ResourceManager.dll
obj\Release\linksrc\System.IO.dll
obj\Release\linksrc\System.Threading.Tasks.dll
obj\Release\linksrc\System.Linq.Expressions.dll
obj\Release\linksrc\System.Reflection.Emit.Lightweight.dll
obj\Release\linksrc\System.Reflection.Emit.ILGeneration.dll
obj\Release\linksrc\System.Reflection.TypeExtensions.dll
obj\Release\linksrc\System.Reflection.Primitives.dll
obj\Release\linksrc\System.Globalization.dll
obj\Release\linksrc\System.AppContext.dll
obj\Release\linksrc\System.IO.FileSystem.dll
obj\Release\linksrc\System.Console.dll
EnableProguard: False
ProguardConfiguration:
DumpDependencies: False
LinkOnlyNewerThan:
HttpClientHandlerType:
TlsProvider:
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: The "LinkAssemblies" task failed unexpectedly.
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: Mono.Linker.MarkException: Error processing method: 'System.Boolean StructureMap.Graph.AssemblyFinder/<FindAssemblies>
d__1::MoveNext()' in assembly: 'StructureMap.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Runtime.Loader.AssemblyLoadContext System.Runtime.Loader.AssemblyLoadContext::get_Default()
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: at Mono.Linker.Steps.MarkStep.ProcessQueue()
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: --- End of inner exception stack trace ---
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: at Mono.Linker.Steps.MarkStep.ProcessQueue()
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: at Mono.Linker.Steps.MarkStep.Process()
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: at Mono.Linker.Pipeline.Process(LinkContext context)
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: at Xamarin.Android.Tasks.LinkAssemblies.Execute()
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1577,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
Done executing task "LinkAssemblies" -- FAILED.
Done building target "_LinkAssembliesShrink" in project "App2.csproj" -- FAILED.
Build FAILED.
In debug mode it compiles as expected but i guess the LinkAssemblies task does not run then.
I'm using Xamarin 4.6.0.297 and Visual Studio 2015.
Is this an issue in StructureMap or Xamarin?
Update:
The seems to be an issue with the Linker and different versions of NetStandard Library. StructureMap is setup as a supporting .Net45, NetStandard 1.3 and NetStandard 1.5 in the nuget, when added NetStandard Lib 1.6 is being brought in and unless you update the packages to NetStandard Lib 2.0 (and its matching libraries), you will receive the Mono.Cecil error:
Mono.Cecil.ResolutionException: Failed to resolve System.Runtime.Loader.AssemblyLoadContext System.Runtime.Loader.AssemblyLoadContext::get_Default()
Note: I'm not sure if this is a problem with Mono.Cecil, the way StructureMap is packaged or the way Xamarin handles the nuget references...
LinkDescription:
A linker configuration like the following will get you around the issue:
<linker>
<assembly fullname="StructureMap">
<namespace fullname="StructureMap.*" />
</assembly>
</linker>
Just add an XML file to your project with the contents from above and assign a build action of LinkDescription to it.
Note: Using AndroidLinkSkip to skip the assembly will not work...
For me, adding a LinkDescription file, using AndroidLinkToSkip, and updating to .NETStandard 2.0 all did not work. Instead, I downgraded StructureMap to 4.4.0 as suggested by https://github.com/structuremap/structuremap/pull/597. That seems to have resolved the issue

Xamarin LinkAssemblies build failure

I'm trying to do a release build of my Xamarin.Android app in Team Services and have got the following error:
The "LinkAssemblies" task failed unexpectedly.
Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Could
not resolve reference to 'System.Void.Android.Support.CustomTabs.CustomTabsIntent::LaunchUrl(Android.App.
Activity,Android.Net.Uri)' (defined in assembly
'Microsoft.Azure.Mobile.Client, Version=4.0.1.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35') with scope
'Xamarin.Android.Support.CustomTabs, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null'. When the scope is different from the defining
assembly, it usually means that the type is forwarded. --->
Mono.Cecil.ResolutionException: Failed to resolve System.Void.Android.Support.CustomTabs.CustomTabsIntent::LaunchUrl(Android.App.Activity,Android.Net.Uri)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext&
context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
--- End of inner exception stack trace ---
at Java.Interop.Tools.Diagnostics.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
I can see that it's probably related to the package Microsoft.Azure.Mobile.Client but not sure what I would have to do to resolve it (I'm quite new to Xamarin so not sure what to do with this information).
My minSdkVersion is 21.
Thanks
It looks like the guys of Microsoft.Azure.Mobile.Client package have problems with Android.Support.CustomTabs library. Please refer to the posted issues on github: Issue 364 and Issue 361. It looks like Microsoft.Azure.Mobile.Client version 4.0.0 can be built against Android.Support.CustomTabs version 25.3.1, but Microsoft.Azure.Mobile.Client version 4.0.1 can be built against Android.Support.CustomTabs version 23.3.0.
In my case downgrading nuget package Microsoft.Azure.Mobile.Client from version 4.0.1 to version 4.0.0 helped to build and link my project.

MEF - wrong assembly version

I have a web app that uses MEF, Webapi and OData.
For MEF I created a helper class that loads the catalog on demand (at first access)
The following is MEF integration code.
Public Shared ReadOnly Property Catalog As AggregateCatalog
Get
If _catalog Is Nothing Then
Dim catFolder = "."
Dim path = AppDomain.CurrentDomain.BaseDirectory.ToLower
_catalog = new AggregateCatalog()
Dim di = New DirectoryInfo(path)
Dim dlls = di.GetFileSystemInfos("MyApp.*.dll")
_catalog = New AggregateCatalog()
For Each dll In dlls
Try
Dim ac = New AssemblyCatalog(Assembly.LoadFile(dll.FullName))
Dim parts = ac.Parts.ToArray() 'throws ReflectionTypeLoadException
_catalog.Catalogs.Add(ac)
Catch ex As ReflectionTypeLoadException
Log.Instance.Error("Error when Trying to load {0}", dll.FullName)
Log.Instance.Error(ex)
For Each iex In ex.LoaderExceptions
Log.Instance.Error(iex)
Next
End Try
Next
End If
Return _catalog
End Get
End Property
One of my projects (the actual web app project) uses the following nuget packages (among others):
WebApi 5.2.3
WebApi.OData 5.7.0
My problem is when MEF class tries to load this assembly (the one that uses OData and WebApi, it thrown a runtime error, which is logged below.
The problem occurs ONLY in deployment, on production machine. In development all works ok.
As you can see in the error below, it seems that, even if the project references System.Web.Http version 5.2.3.0, at runtime System.Web.Http.Odata assembly is trying to load System.Web.Http version 5.2.2.0 (!?!?!?)
In my project, the reference is set to correct dll (version 5.2.3.0), the dll is set with Copy Local=True, and in web.config I have
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
I don't have any class needed to be composed by MEF in this project (assembly), so I could simply exclude it from being load by MEF, but this error is puzzling me, and I would like to find a solution, in case I encounter similar problem in other assemblies.
Here is the error I get
2015-11-04 07:17:02.7758|ERROR|MyPermitNow.Log|Error when Trying to load m:\web\www.mypermitnow.org\web_1\bg-processor\MyPermitNow.Jurisdiction.dll
2015-11-04 07:17:02.7758|ERROR|MyPermitNow.Log|System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog()
at System.ComponentModel.Composition.Hosting.AssemblyCatalog.GetEnumerator()
at System.Linq.EnumerableQuery`1.GetEnumerator()
at System.Linq.EnumerableQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at MyPermitNow.MEFHelper.get_Catalog()
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog()
at System.ComponentModel.Composition.Hosting.AssemblyCatalog.GetEnumerator()
at System.Linq.EnumerableQuery`1.GetEnumerator()
at System.Linq.EnumerableQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at MyPermitNow.MEFHelper.get_Catalog()
2015-11-04 07:17:02.7758|ERROR|MyPermitNow.Log|System.IO.FileLoadException: Could not load file or assembly 'System.Web.Http, Version=5.2.2.0, 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)
File name: 'System.Web.Http, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
=== Pre-bind state information ===
LOG: DisplayName = System.Web.Http, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///M:/web/www.mypermitnow.org/web_1/bg-processor/
LOG: Initial PrivatePath = NULL
Calling assembly : System.Web.Http.OData, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: System.Web.Http, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///M:/web/www.mypermitnow.org/web_1/bg-processor/System.Web.Http.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
There could be a lot of things that could cause this. Some things to check:
Is there an old version of the DLL on the server having problems? It is possible the CSPROJ now has Private=true for the assembly when it didn't use to, then that library is included in the main applicate/site project. So the new one isn't getting copied, but the old one is sitting there but in a more direct spot so it is loading first.
Any app/web.config transforms going on that could be replacing the assembly binding XML?
If it's not in the direct application folders, what's in the GAC?
Turn on the Fusion assembly loading logging

Resources