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

Self contained apps fail to build with AnyCPU & RIDs #2684

Open
mattleibow opened this issue Jun 28, 2022 · 6 comments
Open

Self contained apps fail to build with AnyCPU & RIDs #2684

mattleibow opened this issue Jun 28, 2022 · 6 comments
Assignees
Labels
area-Deployment Issues related to packaging, installation, runtime (e.g., SelfContained, Unpackaged) bug Something isn't working maui-7.x Bugs targeted for maui-7.x

Comments

@mattleibow
Copy link

Describe the bug

When building a self contained app that uses a RID instead of the platform, the build fails:

C:\Users\mattl.nuget\packages\microsoft.windowsappsdk\1.1.1\buildTransitive\Microsoft.WindowsAppSDK.SelfContained.targets(42,5): error : The platform 'AnyCPU' is not supported for Self Contained mode.

@Scottj1s I believe this is similar to another issue before with copying things. I copied the changes you made in the _GetProjectArchitecture target and it works here too.

image

Steps to reproduce the bug

    <IsUnpackaged>true</IsUnpackaged>
    <WindowsPackageType Condition="'$(IsUnpackaged)' == 'true'">None</WindowsPackageType>
    <WindowsAppSDKSelfContained Condition="'$(IsUnpackaged)' == 'true'">true</WindowsAppSDKSelfContained>
    <SelfContained Condition="'$(IsUnpackaged)' == 'true'">true</SelfContained>

Expected behavior

Builds

Screenshots

No response

NuGet package version

1.1.1

Packaging type

Unpackaged

Windows version

No response

IDE

No response

Additional context

No response

@sbanni
Copy link

sbanni commented Jun 28, 2022

@mattleibow The check needs to include "Any CPU" as well. When building a .sln a .metaproj gets generated that converts "Any CPU" to "AnyCPU" but if you build the .proj file directly this doesn't happen and this check breaks.

@mattleibow
Copy link
Author

This AnyCPU vs Any CPU might affect the other locations as well then? AnyCPU is used a lot in the targets generally.

@sbanni
Copy link

sbanni commented Jun 30, 2022

This AnyCPU vs Any CPU might affect the other locations as well then? AnyCPU is used a lot in the targets generally.

Yes, there is already another bug I filed here where I am hitting this issue. Would be a good idea to scrub the the whole repo.

@btueffers btueffers added bug Something isn't working area-DeveloperTools Issues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integration and removed needs-triage labels Jul 14, 2022
@mattleibow mattleibow added the maui-7.x Bugs targeted for maui-7.x label Nov 17, 2022
@bpulliam bpulliam added area-Deployment Issues related to packaging, installation, runtime (e.g., SelfContained, Unpackaged) and removed area-DeveloperTools Issues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integration labels Nov 28, 2022
@gary-89
Copy link

gary-89 commented Dec 2, 2022

Discussion/3026 helped me to solve this issue.
Just add the platform parameter to your command with -p:Platform=....

@mattleibow
Copy link
Author

In most modern frameworks - such as maui - we use RIDs. So, it does work with Platform, but I am explicitly not using it.

@mattleibow
Copy link
Author

Related to #4008

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Deployment Issues related to packaging, installation, runtime (e.g., SelfContained, Unpackaged) bug Something isn't working maui-7.x Bugs targeted for maui-7.x
Projects
None yet
Development

No branches or pull requests

7 participants