Steps to reproduce:
Create a XAF Blazor application with the Reports V2 Blazor module;
Try to publish it with the following settings
Alternatively, publish it via a console:
C:\Users\Admin\source\repos\T1004441_Sample\T1004441_Sample.Blazor.Server>dotnet publish --runtime win-x64 --self-contained true
Actual results:
Publishing fails with the NU1605 error. See the Publish output for details.
Workaround:
Use the solution from the following help topic: NuGet Warning NU1605.
Add the following PackageReference to your Blazor project:
XML<ItemGroup>
<PackageReference Include="Microsoft.NETCore.Targets" Version="5.0.0" />
</ItemGroup>
Publish output:
CodeBuild started...
1>------ Build started: Project: T1004441_Sample.Module, Configuration: Release Any CPU ------
1>T1004441_Sample.Module -> C:\Users\Admin\source\repos\T1004441_Sample\T1004441_Sample.Module\bin\Release\net5.0\T1004441_Sample.Module.dll
2>------ Build started: Project: T1004441_Sample.Module.Blazor, Configuration: Release Any CPU ------
2>T1004441_Sample.Module.Blazor -> C:\Users\Admin\source\repos\T1004441_Sample\T1004441_Sample.Module.Blazor\bin\Release\net5.0\T1004441_Sample.Module.Blazor.dll
3>------ Build started: Project: T1004441_Sample.Blazor.Server, Configuration: Release Any CPU ------
3>T1004441_Sample.Blazor.Server -> C:\Users\Admin\source\repos\T1004441_Sample\T1004441_Sample.Blazor.Server\bin\Release\net5.0\T1004441_Sample.Blazor.Server.dll
3>T1004441_Sample.Blazor.Server -> C:\Users\Admin\source\repos\T1004441_Sample\T1004441_Sample.Blazor.Server\bin\Release\net5.0\T1004441_Sample.Blazor.Server.Views.dll
4>------ Publish started: Project: T1004441_Sample.Blazor.Server, Configuration: Release Any CPU ------
Connecting to C:\Users\Admin\source\repos\T1004441_Sample\T1004441_Sample.Blazor.Server\bin\Release\net5.0\publish\...
Determining projects to restore...
Restored C:\Users\Admin\source\repos\T1004441_Sample\T1004441_Sample.Module\T1004441_Sample.Module.csproj (in 1.19 sec).
C:\Users\Admin\source\repos\T1004441_Sample\T1004441_Sample.Module.Blazor\T1004441_Sample.Module.Blazor.csproj(0,0): Error NU1605: Detected package downgrade: System.Diagnostics.Debug from 4.3.0 to 4.0.11. Reference the package directly from the project to select a different version.
T1004441_Sample.Module.Blazor -> DevExpress.ExpressApp.ReportsV2.Blazor 21.1.3 -> DevExpress.Blazor.Reporting.JSBasedControls 21.1.3 -> DevExpress.AspNetCore.Reporting 21.1.3 -> Microsoft.AspNetCore.Mvc.Core 2.0.0 -> Microsoft.Extensions.DependencyModel 2.0.0 -> Microsoft.DotNet.PlatformAbstractions 2.0.0 -> System.IO.FileSystem 4.0.1 -> runtime.win.System.IO.FileSystem 4.3.0 -> System.Diagnostics.Debug (>= 4.3.0)
T1004441_Sample.Module.Blazor -> DevExpress.ExpressApp.ReportsV2.Blazor 21.1.3 -> DevExpress.Blazor.Reporting.JSBasedControls 21.1.3 -> DevExpress.AspNetCore.Reporting 21.1.3 -> Microsoft.AspNetCore.Mvc.Core 2.0.0 -> Microsoft.Extensions.DependencyModel 2.0.0 -> System.Diagnostics.Debug (>= 4.0.11)
...
4>Build failed. Check the Output window for more details.
========== Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ===========