Open mjcheetham opened 3 years ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
Tagging subscribers to this area: @agocke, @vitek-karas, @vsadov See info in area-owners.md if you want to be subscribed.
Author: | mjcheetham |
---|---|
Assignees: | - |
Labels: | `area-Single-File`, `untriaged` |
Milestone: | - |
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
Related (possibly a duplicate) to: https://github.com/dotnet/sdk/issues/16184 - propagation of properties https://github.com/dotnet/sdk/issues/15117 - SDK should prevent mismatched configurations (since it is broken) https://github.com/dotnet/sdk/issues/1675 (fixed in https://github.com/dotnet/sdk/pull/14488) - support at least some configurations of exe->exe references correctly.
I tried this with 6 Preview 4 nightly and the wpfapp pops up a dialog that it's missing a shared framework. This is basically expected. The cli is published as self-contained and the wpfapp is published as framework dependent (no RID propagation) into the same folder. The host will detect the presence of self-contained-like files in the folder and will treat wpfapp as self-contained to a degree as well. Basically the files on disk and the runtimeconfig.json for wpfapp are not in sync and the host gets confused.
If #16184 is implemented it would probably try to publish both as self-contained and it "might" work - not sure how SDK would handle runtime pack asset deduplication in this case though.
publishing with /p:PublishSingleFile=true
will also not work - the WPF app in this case is "corrupted" in a slightly different way and it won't start either (and not show anything). In this case it's because the wrong host was chosen (using apphost, but publishing as single-file-like). I assume this is also because the RID is not propagated.
Feels like #15117 would be a pretty poor "fix" for this scenario. The same scenario that works today in .NET Framework and .NET Core/5.x with FD deployments would be an error in 5/6.x.
All the assumptions so far have been a single top-level application, without thought for multi-executable "products" that share code.
Versions
Problem(s)
Publishing an application (as self contained) that has another application project (not a class library) as a dependency does not pass through the chosen runtime identifier to child projects.
Publishing (as a single-file) a console application that has a WPF application/project as a dependency emits a broken AppHost for the child project.
Repro Steps
Please see a full reproduction of the bugs in this repository:
https://github.com/mjcheetham/bug-wpfconsole
Simplified Repro
Edit
cli\cli.csproj
:Remarks
Note that publishing not self contained and not as a single file works OK. The problems occur in handling of AppHost vs SuperHost, and in passing of all properties to the child
Publish
targets.