How to add Xamarin.Auth to a new (created with VS 2017.5.2) Xamarin app using .NetStandard for the common project

197 Views Asked by At

After many false starts, I added the Microsoft.NETCore.Portable.Compatibility NuGet package to the common project and was then able to add the Xamarin.Auth package and compile the common project. I then added the Xamarin.Auth package to my Android and UWP projects and things went south in a hurry. Compiling the Android project gives me about 4300 errors and indicates that the base classes are defined twice with the following error.

Multiple assemblies with equivalent identity have been imported: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll' and 'C:\Users\Roy\.nuget\packages\microsoft.netcore.portable.compatibility\1.0.1\ref\netstandard1.0\mscorlib.dll'. Remove one of the duplicate references.

The UWP application error is more cryptic. It says

Could not locate C:\NorSoft\MPAPool\MPAApp\MPAApp\MPAApp\packages.config.  Ensure that this project has Microsoft.Bcl.Build installed and packages.config is located next to the project file.

I have added a dummy packages.config. I have added the Microsoft.Bcl.Build package to the project and I have added

<Properties>SkipValidatePackageReferences=true</Properties>

to the <PackageReference> elements in the .csproj file.

0

There are 0 best solutions below