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

System.Private.Windows.Core is not included in the runtime pack #11282

Closed
hez2010 opened this issue Apr 27, 2024 · 10 comments
Closed

System.Private.Windows.Core is not included in the runtime pack #11282

hez2010 opened this issue Apr 27, 2024 · 10 comments
Assignees
Labels
💥 regression-preview Regression from a preview release Priority:0 Work that we can't release without
Milestone

Comments

@hez2010
Copy link

hez2010 commented Apr 27, 2024

.NET version

.NET 9 nightly

Did it work in .NET Framework?

Yes

Did it work in any of the earlier releases of .NET Core or .NET 5+?

No response

Issue description

System.Private.Windows.Core.dll is not included in the runtime pack, and leading to the below exception while running a self-contained published app.

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'System.Private.Windows.Core, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Specified file was not found.
File name: 'System.Private.Windows.Core, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
   at WinformsTest.Program.Main()

Steps to reproduce

dotnet new winforms
dotnet publish -c Release -r win-x64 --self-contained
cd bin\Release\net9.0-windows\win-x64\publish\
.\WinformsTest.exe
@hez2010 hez2010 added the untriaged The team needs to look at this issue in the next triage label Apr 27, 2024
@elachlan elachlan added 💥 regression-preview Regression from a preview release Priority:0 Work that we can't release without labels Apr 29, 2024
@elachlan
Copy link
Contributor

@Olina-Zhang can your team confirm this please?

@Olina-Zhang
Copy link
Member

@Olina-Zhang can your team confirm this please?

I didn't reproduce the problem with the .Net 9.0 Preview3 build machine at hand.
image

@hez2010
Copy link
Author

hez2010 commented Apr 29, 2024

Maybe it happens on the nightly build only?

@Olina-Zhang
Copy link
Member

Maybe it happens on the nightly build only?

For the latest daily build, execute dotnet publish -c Release -r win-x64 --self-contained failed, I am not sure if it needs some config, cannot verify this issue.
image

@merriemcgaw merriemcgaw added this to the 9.0 Preview4 milestone Apr 30, 2024
@Tanya-Solyanik Tanya-Solyanik removed the untriaged The team needs to look at this issue in the next triage label Apr 30, 2024
@lonitra
Copy link
Member

lonitra commented Apr 30, 2024

Tried to repro and got same results as above. Could not repro issue with .NET 9 preview 3 and could not verify with nightly build. I suspect that we do not publish nuget package for unreleased previews which is why the errors are produced. We had previously had an issue similar to this when we first introduced System.Private.Windows.Core, where the assembly was not present and needed to be, but this had since been fixed via dotnet/windowsdesktop#4084. Looked through the history there and it doesn't seem that we had regressed this behavior.

@hez2010 to clarify, had you experienced this issue on .NET 9 Preview 3, nightly build, or both?

@lonitra lonitra added the 📭 waiting-author-feedback The team requires more information from the author label Apr 30, 2024
@hez2010
Copy link
Author

hez2010 commented May 2, 2024

It's reproducing on the nightly build.
To publish the app with nightly build dotnet, you need to configure the nuget source:

<configuration>
  <packageSources>
    <add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
  </packageSources>
</configuration>

I'm using 9.0.100-preview.5.24230.22.

image

@lonitra
Copy link
Member

lonitra commented May 10, 2024

Fixed via dotnet/windowsdesktop#4366 in main and dotnet/windowsdesktop#4369 in preview 4

@lonitra lonitra closed this as completed May 10, 2024
@MelonWang1
Copy link
Contributor

Verified this issue in the latest .NET 9.0 preview4 SDK build: 9.0.100-preview.4.24266.28, it was fixed. Screenshot as below.
Untitled

@Olina-Zhang
Copy link
Member

Verified it in the latest .Net 9.0 Preview 5 SDK build: 9.0.100-preview.5.24273.4, it was fixed: System.Private.Windows.Core.dll is contained in application's publish folder, and app's EXE can be run.

image

@Zheng-Li01
Copy link
Member

Zheng-Li01 commented Jun 5, 2024

Verified the issue on 9.0.100-preview.5.24304.3 Test Pass build, the issue has been fixed that have the same results as above.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💥 regression-preview Regression from a preview release Priority:0 Work that we can't release without
Projects
None yet
Development

No branches or pull requests

8 participants