THIS IS THE ERROR :-
Severity Code Description Project File Line Suppression State
Error The "LinkAssemblies" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'App25, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'App25.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.GetAssembly(String fileName)
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() App25
Answers
Try the follows:
Tutorial: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/troubleshooting/questions/android-linkassemblies-error
no,unfortunately it didn't work.
Have you tried to delete the files of bin and obj folder and then restart the project?
I did try as you said,but no success again.
As a quick idea in case it might be helpful, usually when the name of the assembly ("App25" in this case) mentioned in this error is one of the projects in your solution, it means that the project (App25 in this case) did not build successfully, so to resolve this "Could not load assembly" error, you'll want to look for the other errors in the build output to find the reason why the App25 project did not build successfully. (It might be something as small as a missing
;
at the end of a line in one of the .cs files in the App25 project, for example.)(As one more little side note, this misleading "Could not load assembly" error that happens during the "LinkAssemblies" task should no longer happen starting with the current Xamarin.Android 9.4 preview version. So in that version and above, only the "real" error from the App25 project should appear, making it easier to track down the cause of the problem.)
Hi,
I'm stumbling on the same issue.
The build works fine in debug but fails in release with the same error message.
Inspecting the build log for hints on other errors doesn't lead to anything, I just have a few warnings (they are the same in Debug mode). If I look in the bin/Release folder I can see the dll the LinkAssemblies fails to find.
I found a thread on the Developer Community but the workaround mentioned (clean and restart VS2019) doesn't seem to be working in my case.
The solution, in my case, has been to disable Code Analysis on Build in the Project Build settings