Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET 5 Preview 8 ReadyToRunCompiler task failure #41623

Closed
isaacrlevin opened this issue Aug 31, 2020 · 13 comments
Closed

.NET 5 Preview 8 ReadyToRunCompiler task failure #41623

isaacrlevin opened this issue Aug 31, 2020 · 13 comments
Assignees
Milestone

Comments

@isaacrlevin
Copy link

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

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-ReadyToRun-coreclr untriaged New issue has not been triaged by the area owner labels Aug 31, 2020
@isaacrlevin
Copy link
Author

cc @mangod9

@mangod9 mangod9 modified the milestones: 5.0.0 Preview 8, 5.0.0 Aug 31, 2020
@mangod9
Copy link
Member

mangod9 commented Aug 31, 2020

Hi @isaacrlevin, is this a regression in p8 ? Adding @AntonLapounov since he has worked on PublishReadyToRun recently

@jeffschwMSFT jeffschwMSFT removed the untriaged New issue has not been triaged by the area owner label Aug 31, 2020
@isaacrlevin
Copy link
Author

It worked in Preview 7, so unless I am doing something wrong, it is a regression

@AntonLapounov
Copy link
Member

@isaacrlevin Do you hit the same issue with a new WPF project ("dotnet new wpf")?

@isaacrlevin
Copy link
Author

I do not, this happens when I run a build in Azure DevOps, it works locally and I have no idea why

@AntonLapounov
Copy link
Member

@isaacrlevin Thank you for trying that. Did you use the same SDK version (5.0.100-preview.8.20417.9) locally? Or was it a different version?

@isaacrlevin
Copy link
Author

Same SDK. Here is the solution that is not working
https://github.com/isaacrlevin/PresenceLight/

Highlighted task that fails
https://github.com/isaacrlevin/PresenceLight/blob/main/azure-pipelines-wpf.yml#L105

More than happy to modify anything to get to work

@AntonLapounov
Copy link
Member

I have reproduced the issue. The extra winrt.runtime.dll comes from Microsoft.Windows.SDK.Net.Ref package, which was added in dotnet/sdk#12232 by @wli3.

@mangod9
Copy link
Member

mangod9 commented Sep 3, 2020

Is the fix to remove one include of winrt.runtime.dll ?

@AntonLapounov
Copy link
Member

Indeed, removing OSVersionHelper from these two files fixes the issue:
https://github.com/isaacrlevin/PresenceLight/blob/c45100c7a44c4e7c5cd71e0530b2d5b315e35ef8/src/PresenceLight/PresenceLight.csproj#L31
https://github.com/isaacrlevin/PresenceLight/blob/c45100c7a44c4e7c5cd71e0530b2d5b315e35ef8/src/PresenceLight/Telemetry/ThisAppInfo.cs#L5

The old version of OSVersionHelper adds a dependency on the old Microsoft.Windows.SDK.NET package:

      "OSVersionHelper/1.1.5-preview": {
        "dependencies": {
          "Microsoft.Windows.SDK.NET": "10.0.18362.3-preview"
        },

which conflicts with the new runtimepack.Microsoft.Windows.SDK.NET.Ref/10.0.19041.1-preview package: both of them come with WinRT.Runtime.dll assembly.

@isaacrlevin Please either remove references to OSVersionHelper or follow up with the package owner regarding the updated version (I tried the latest 1.1.14-preview version and it failed with a different error).

@isaacrlevin
Copy link
Author

@clairernovotny FYI :)

@wli3
Copy link

wli3 commented Sep 3, 2020

If you use "net5.0-windows10.0.19041" you opt-in adding Microsoft.Windows.SDK.Net.Ref which is expected. Where is the other winrt.runtime.dll comes from?

@wli3
Copy link

wli3 commented Sep 3, 2020

microsoft.windows.cswinrt should not be used at the same time. Try remove the reference to that package

@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants