AppCenter with WinForm - Dilemma: Must use PackageReference or Multiple assemblies error for System.Runtime.WindowsRuntime.dll

SmilingMoon 981 Reputation points
2021-11-13T00:52:20.813+00:00

Trying to add MS AppCenter to Windows Form project.
But, got dilemma: facing "Must use PackageReference" or "Multiple assemblies with equivalent identity have been imported"

  1. Add "Windows Forms App (.NET Framework)" project
  2. Add Microsoft.AppCenter, Analytics and Crashes Nuget packages 4.4.0 version.
  3. Build the project

I got build error: "Must use PackageReference"

1> WindowsFormsApp2 -> D:\Projects\SkyOnTheWay\BulkPhotoEditor-BR-Free\WindowsFormsApp2\bin\Debug\WindowsFormsApp2.exe
1>D:\Projects\TestApp\packages\Microsoft.Windows.SDK.Contracts.10.0.18362.2005\build\Microsoft.Windows.SDK.Contracts.targets(4,5): error : Must use PackageReference

  1. Add System.Runtime.WindowsRuntime.dll and build it, and got build Error

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore\v4.5\System.Runtime.WindowsRuntime.dll
1>CSC : error CS1703: Multiple assemblies with equivalent identity have been imported: 'D:\Projects\TestApp\packages\System.Runtime.WindowsRuntime.4.6.0\ref\netstandard2.0\System.Runtime.WindowsRuntime.dll' and 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore\v4.5\System.Runtime.WindowsRuntime.dll'. Remove one of the duplicate references.

  1. Remove the reference and build it. "Must use PackageReference" build error occurred.

There is no solution I found from search.

I referenced the System.Runtime.WindowsRuntime.dll to the Nuget package file. It doesn't work.

Is it NOT available to support AppCenter in windows form project?

Developer technologies | Windows Forms
{count} votes

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.