Unable to build solution using Visual Studio 2019 Xamarin

Ashish Dhar 61 Reputation points
2020-11-21T15:52:10.253+00:00

Hi,

I am new Xamarin. I am facing a problem while build the solution.
Following error is showing while building the project.

Severity Code Description Project File Line Suppression State
Error The "ResolveAssemblyReference" task failed unexpectedly.
System.Security.SecurityException: Invalid assembly public key. (Exception from HRESULT: 0x8013141E)
at System.Reflection.AssemblyName.nToString()
at System.Reflection.AssemblyName.get_FullName()
at Microsoft.Build.Tasks.ReferenceTable.GetReferenceItems(ITaskItem[]& primaryFiles, ITaskItem[]& dependencyFiles, ITaskItem[]& relatedFiles, ITaskItem[]& satelliteFiles, ITaskItem[]& serializationAssemblyFiles, ITaskItem[]& scatterFiles, ITaskItem[]& copyLocalFiles)
at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute(FileExists fileExists, DirectoryExists directoryExists, GetDirectories getDirectories, GetAssemblyName getAssemblyName, GetAssemblyMetadata getAssemblyMetadata, GetRegistrySubKeyNames getRegistrySubKeyNames, GetRegistrySubKeyDefaultValue getRegistrySubKeyDefaultValue, GetLastWriteTime getLastWriteTime, GetAssemblyRuntimeVersion getRuntimeVersion, OpenBaseKey openBaseKey, GetAssemblyPathInGac getAssemblyPathInGac, IsWinMDFile isWinMDFile, ReadMachineTypeFromPEHeader readMachineTypeFromPEHeader)
at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
The Zone of the assembly that failed was:
MyComputer TestProject.Android

But in another project I am not getting this error and it builds successfully.

Requesting how to overcome this situation.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,349 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ashish Dhar 61 Reputation points
    2020-11-24T05:22:42.417+00:00

    Thanks.

    I had resolved the issue. I had unchecked the Signed the assembly in signing property.

    41988-image.png

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.