Thursday, January 16, 2020

Code Analysis for C#

  • CA1801: Unused parameters
(Object sender, EventArgs e) cannot be removed from UWP but it shows warnings. There is some discussions to avoid warning, and then I set (_1, _2)
https://github.com/dotnet/roslyn-analyzers/issues/2338#issuecomment-489806299

Violation

Violation fixed


Friday, January 3, 2020

UWP app 101

- Error when adding a xUnit Test project
Error NU1201 Project FileUploaderAdal is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Project FileUploaderAdal supports: uap10.0.17763 (UAP,Version=v10.0.17763) FileUploaderAdal.xUnitTests C:\dev\testdevops\FileUploaderAdal\FileUploaderAdal.xUnitTests\FileUploaderAdal.xUnitTests.csproj

.NET Core app cannot add a reference to UWP app and vice versa.

Soluiton: Create one project with .NET Standard and put classes you want to test, which UWP and xUnit .NET Core both can access.