Hi,
I'm getting the below error while building the application using linking SDK assemblies option and with out shared runtime (as shared run time causing error while release the application.)
Severity Code Description Project File Line Suppression State
Error The "LinkAssemblies" task failed unexpectedly.
Mono.Linker.MarkException: Error processing method: 'System.Void System.Net.Http.HttpClientHandler/c__async0::MoveNext()' in assembly: 'System.Net.Http.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void System.Net.WebHeaderCollection::AddValue(System.String,System.String)
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.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(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() \Program Files\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 1577
if shared runtime option is unchecked and link option none httpclient.GetStringAsync() method will raise the following error
Method 'System.Net.WebHeaderCollection.AddValue' not found.
but application is working fine when the shared runtime option is ticked and 'SDK assemblies only' link option selected in the android options tab.
I could find lot of similar threads but couldn't find any solution for this one.
Thanks,
Eins