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

[NETSDKE2E]The winforms application which is generated by self-contained publish cannot run successfully. #40173

Closed
vdanche opened this issue Apr 15, 2024 · 9 comments
Labels
Area-NetSDK untriaged Request triage from a team member

Comments

@vdanche
Copy link
Member

vdanche commented Apr 15, 2024

Build:
9.0.100-preview.4.24214.1(runtime-9.0.0-preview.4.24211.4)

Repro:
1.dotnet new winforms
2.dotnet publish -r win-x64 --self-contained
3.in publish directory, double-click exe file

Expected:
exe file can run successfully
Actual Result:
There is no any response after double-click exe file
image
run dll file, file crash
image
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'System.Private.Windows.Core, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.
File name: 'System.Private.Windows.Core, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
at win1.Program.Main()

dotnet --info:
image

Note:
running WinForms successfully.
image

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NetSDK untriaged Request triage from a team member labels Apr 15, 2024
@vdanche vdanche changed the title [NETSDKE2E]The winfroms application which is generated by self-contained publish cannot run successfully. [NETSDKE2E]The winforms application which is generated by self-contained publish cannot run successfully. Apr 15, 2024
@v-ainigao
Copy link

This issue also repro's on ARM64OS.
build: .net9.0.100-preview.4.24215.10(runtime-9.0.0-preview.4.24211.4)
image

@marcpopMSFT
Copy link
Member

@agocke @elinor-fung is there an issue with the host or with our publish?

@agocke
Copy link
Member

agocke commented Apr 26, 2024

I think that depends on whether or not there is in fact a System.Private.Windows.Core in the output directory. If there isn't, I think this is just a bug in publish in gathering output assemblies.

@v-ainigao
Copy link

I think that depends on whether or not there is in fact a System.Private.Windows.Core in the output directory. If there isn't, I think this is just a bug in publish in gathering output assemblies.

System.Private.Windows.Core does not exist in the publish output directory.
image
image

@richaverma1
Copy link

This is a blocker. Who should look at it @agocke @marcpopMSFT ?

@marcpopMSFT
Copy link
Member

@dsplaisted Any ideas here? In 8.0, we had no reference to System.Private.Windows.Core but now in 9, I see it showing up in ResolveTargetingPackAssets so we consider it a reference but not needed at runtime.

@dsplaisted
Copy link
Member

Sounds like this may be the same as dotnet/winforms#11282

@marcpopMSFT
Copy link
Member

@LakshanF @lonitra were you planning on merging this to your preview 4 branch as it's blocking winforms self-contained scenarios?

@vdanche
Copy link
Member Author

vdanche commented May 9, 2024

This issue has been fixed on 9.0.100-preview.4.24258.4(runtime-9.0.0-preview.4.24252.19)
image

FYI @richaverma1

@vdanche vdanche closed this as completed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NetSDK untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

6 participants