-
Notifications
You must be signed in to change notification settings - Fork 329
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
Passing MSBuild properties on the CLI throws errors #4008
Comments
I'm trying to publish a Packaged app with
|
Hi, I have tried to add to both project (I also have tried a mix of options) <PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows' and '$(RuntimeIdentifierOverride)' != ''">
<RuntimeIdentifier>$(RuntimeIdentifierOverride)</RuntimeIdentifier>
</PropertyGroup>
<Target Name="WindowsAppSDKSelfContainedVerifyConfiguration"></Target>
<WindowsPackageType Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">None</WindowsPackageType>
<WindowsAppSDKSelfContained>True</WindowsAppSDKSelfContained>
<PublishSingleFile>True</PublishSingleFile>
<SelfContained>True</SelfContained> to try to create a single EXE of my application. I used this command: but I always get this error (LibMobile is the library project): |
Setting |
This also happens when setting Platform to anything other than x64 for me... I need multi platform support on this here, otherwise this is a mess to work with... |
@anpin only workaround I know is described in dotnet/maui#9064 (comment) I had this problem also in .NET 7.. /obj/Release/net8.0-windowsxxxxx/win10-x64/MsixContent/ Then you need to manually copy it into the other projects under /obj/Release/net8.0-windowsxxxxx/win10-x64/ in an "MsixContent" folder (you have to create it). Then run with your full publish command using the -p:WindowsAppSDKSelfContained=true I really don't know whats causing this..but the WindowsAppSDKSelfContained param surely is somehow guilty and the fact that it only occurs only multi-project solutions. |
@mattleibow The error message is correct. Using the I'm going to close this issue because ultimately it's the result of downstream consequences of attempting to workaround #3337. For everybody else in this thread, unless your scenario is exactly the same as that described by Mathew in #3337 and the information I posted in #3337 (comment) does not resolve the issues you are encountering please open a new issue so that it can be tracked separately instead of getting lost amongst the comments of this unrelated issue. |
Describe the bug
I have a maui app which has a maui library. When I publish the app:
I get this error: #3337
I fixed this by adding the RID to the csproj:
Now I can pass
-p:RuntimeIdentifierOverride=win10-x64
instead:I still get this error:
I partially worked around this by doing this: #2684 and adding this to my
DirectoryBuild.targets
:Now I get another error:
I can work around this by adding this to my csproj:
I have worked around this in .NET maui by making all unpackaged apps be WindowsAppSDKSelfContained by default, but MSIX apps still need to do this sometimes.
Steps to reproduce the bug
dotnet publish -f net8.0-windows10.0.19041.0 -c Release -r win10-x64 -p:WindowsAppSDKSelfContained=true -p:SelfContained=true
Expected behavior
Publish works
Screenshots
No response
NuGet package version
Windows App SDK 1.4.3: 1.4.231115000
Packaging type
Packaged (MSIX), Unpackaged
Windows version
No response
IDE
Other
Additional context
No response
The text was updated successfully, but these errors were encountered: