简体   繁体   中英

.NET MAUI .csproj MSBUILD

When I am developing my MAUI application and I press build. The build process runs for all platforms (I am on windows). But what I want to achieve is build specific to emulator and configuration I have chosen, to speed things up.

I develop mobile app for android and iOS but sometimes I test it on Windows and my colegues on MAC.

So for release it is simple:

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
    <TargetFrameworks>net6.0-android;net6.0-ios</TargetFrameworks>
</PropertyGroup>

but for Debug we currently have just:

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
    <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
    <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('osx'))">$(TargetFrameworks);net6.0-maccatalyst</TargetFrameworks>
</PropertyGroup>

What we want to achieve is build specific to current debug emulator/machine that is specified up here: https://i.imgur.com/mFZTuCn.png

So in case we have chosen

on the other hand

Is something like this even possible? Yes, I could theoretically temporarily comment out those frameworks I dont want to build for, but I would rather solve it the MSBUILD way.

But what I want to achieve is build specific to emulator and configuration I have chosen, to speed things up.

You can right click on.csproj and then click Properties. In Application, uncheck the platform you don't want to build. It will automatically comment out those frameworks you don't want to build for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM