Cannot run "dotnet publish" for windows desktop if referenced project targets netX-android or netX-ios #18266
Unanswered
gentledepp
asked this question in
Q&A
Replies: 1 comment
-
That is why the X-plat template has a project for each target. Platform specific code should go there. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
I am not sure if this belongs here.
I created a repro here: https://github.com/gentledepp/AvaloniaXpatTest/tree/repro/publishbreaks
This is a very simple out-of-the-box Avalonia XPat application.
Running
dotnet publish .\avaloniaxpattest.desktop\AvaloniaXpatTest.Desktop.csproj -c Release -r win-x64 --self-contained true -o ./publish/x64
works fine, as long as the AvaloniaXpatTest project does not have the following target frameworks defined:
<TargetFrameworks>net9.0;net9.0-windows;net9-android;net9-ios</TargetFrameworks>
so when adding "net9-android" or "net9-ios", the build breaks with:
This command was can also be found in the repository (publish.ps1)
To Reproduce
dotnet publish .\avaloniaxpattest.desktop\AvaloniaXpatTest.Desktop.csproj -c Release -r win-x64 --self-contained true -o ./publish/x64
all is good.
<TargetFrameworks>
AvaloniaXpatTest.csprojdotnet publish .\avaloniaxpattest.desktop\AvaloniaXpatTest.Desktop.csproj -c Release -r win-x64 --self-contained true -o ./publish/x64
not good:
Expected behavior
that it publishes without errors
Avalonia version
11.2.4
OS
Windows
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions