I am attempting to publish a .NET 5 P8 WPF project and get the following error
C:\Program Files\dotnet\sdk\5.0.100-preview.8.20417.9\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(397,28): error MSB4094: "C:\Users\islevin.nuget\packages\microsoft.windows.cswinrt\0.1.0-prerelease.200512.7\lib\netcoreapp5.0\winrt.runtime.dll;C:\Users\islevin.nuget\packages\microsoft.windows.sdk.net.ref\10.0.19041.1-preview\lib\WinRT.Runtime.dll" is an invalid value for the "CompilationEntry" parameter of the "RunReadyToRunCompiler" task. Multiple items cannot be passed into a parameter of type "Microsoft.Build.Framework.ITaskItem". [D:\dev\Personal\PresenceLight\src\PresenceLight\PresenceLight.csproj]
Seems that a particular .dll is being passed twice for whatever reason. Here is the command I am running
dotnet publish -c Release /p:PublishProfile=Properties/PublishProfiles/WinX64.pubxml
And the contents of the publish file
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>x64</Platform>
<TargetFramework>net5.0-windows10.0.19041</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun>True</PublishReadyToRun>
<PublishTrimmed>False</PublishTrimmed>
</PropertyGroup>
</Project>
If I set PublishReadyToRun to false, publish works as expected. Can provide my .props or .csproj if needed
I am attempting to publish a .NET 5 P8 WPF project and get the following error
Seems that a particular .dll is being passed twice for whatever reason. Here is the command I am running
And the contents of the publish file
If I set PublishReadyToRun to false, publish works as expected. Can provide my .props or .csproj if needed