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

Fix incorrect apphost being used when publishing for self-contained single-file with NoBuild=true #45060

Closed

Conversation

elinor-fung
Copy link
Member

The _GetAppHostCreationConfiguration target sets the _UseSingleFileHostForPublish property, which determines if we (re-)create the app using singlefilehost on publish. When publishing with NoBuild=true, the target was not being run, so we bundled using apphost, resulting in an app that was configured to be self-contained but did not actually have the runtime as part of itself.

This change chains the target into the computation for output paths to ensure that the target runs when publishing without building, so that the correct host is used.

See https://developercommunity.visualstudio.com/t/Single-file-self-contained-failing-after/10794374

MiYanni and others added 30 commits November 5, 2024 13:34
…0241105.8

Microsoft.SourceBuild.Intermediate.templating , Microsoft.TemplateEngine.Abstractions , Microsoft.TemplateEngine.Mocks
 From Version 10.0.100-alpha.1.24553.1 -> To Version 10.0.100-alpha.1.24555.8
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <[email protected]>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <[email protected]>
Co-authored-by: Jason Zhai <[email protected]>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <[email protected]>
Co-authored-by: Jason Zhai <[email protected]>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Matt Thalman <[email protected]>
Co-authored-by: Viktor Hofer <[email protected]>
Co-authored-by: Viktor Hofer <[email protected]>
Co-authored-by: Michael Simons <[email protected]>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…106.3

Microsoft.SourceBuild.Intermediate.fsharp , Microsoft.FSharp.Compiler
 From Version 9.0.200-beta.24555.1 -> To Version 9.0.200-beta.24556.3
…0241106.3

dotnet-dev-certs , dotnet-user-jwts , dotnet-user-secrets , Microsoft.AspNetCore.Analyzers , Microsoft.AspNetCore.App.Ref , Microsoft.AspNetCore.App.Ref.Internal , Microsoft.AspNetCore.App.Runtime.win-x64 , Microsoft.AspNetCore.Authorization , Microsoft.AspNetCore.Components.SdkAnalyzers , Microsoft.AspNetCore.Components.Web , Microsoft.AspNetCore.Mvc.Analyzers , Microsoft.AspNetCore.Mvc.Api.Analyzers , Microsoft.Extensions.FileProviders.Embedded , Microsoft.Extensions.ObjectPool , Microsoft.JSInterop , VS.Redist.Common.AspNetCore.SharedFramework.x64.10.0 , Microsoft.SourceBuild.Intermediate.aspnetcore
 From Version 10.0.0-alpha.2.24556.1 -> To Version 10.0.0-alpha.2.24556.3
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-ILLink untriaged Request triage from a team member labels Nov 23, 2024
@am11
Copy link
Member

am11 commented Nov 23, 2024

A workaround for SDK 9.0.100 users is to add this block in their project file:

<Target Name="_Workaround_dotnet_sdk_45060" BeforeTargets="_GetComHostPaths">
  <CallTarget Targets="_GetAppHostCreationConfiguration" />
</Target>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-ILLink untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.