0

Seemingly out of nowhere, my Azure pipeline that ran the dotnet publish command for a MAUI project is failing with the error Resources/Styles/Colors.xaml : error : The name 'Resources' is reserved and cannot be used.

The target of the project is net8.0-ios. The pipeline installs the .NET 8.0.100 SDK, which it has always done since it was created. It uses mac os 13 and xCode 15.2 - both of which haven't changed either. This builds fine locally on a mac, with the .NET 8.0.100 sdk.

From what I can see the only thing that has changed is the version of the .NET core command line task that runs the publish command - in the last successful build it was 2.242.0 and it is now 2.242.1 (this is not something I have explicitly changed). No code has changed, no nuget packages have been updated or anything of the sort.

After looking at the error I had a look at my csproj and noticed it had a section for compiling Colors.xaml - which some of my other MAUI projects (whose pipelines did run) did not have, so I removed it.

  <ItemGroup>
    <MauiXaml Remove="Resources\Styles\Colors.xaml" />
  </ItemGroup>
  <ItemGroup>
    <BundleResource Include="Resources\Styles\Colors.xaml">
      <Generator>MSBuild:Compile</Generator>
    </BundleResource>
  </ItemGroup>

After making this change, the build now passes. However, upon delivery to app store connect I am faced with the infamous ITMS-90078: Missing Push Notification Entitlement warning. I have read this can be caused by 3rd party libraries, but as I mentioned previously, none of my nuget package versions have updated and there hasn't been any code changes. My best guess is this has come from the AppCenter nuget package (which I will be removing soon, as AppCenter is being retired), but I can't prove this is the case until I remove it. I still don't understand why this happened all of a sudden. Would the change in .NET Core task version be enough to have caused these issues? I'm just trying to understand What has happened here.

0

2 Answers 2

1

I think ultimately I'm going to go down the self hosted agent route, so I can control which maui workload version is installed and only upgrade when we've tested & confirmed everything works. In the short term, I've managed to control which version of maui is installed on the pipeline agent by using dotnet workload install maui --from-rollback-file https://maui.blob.core.windows.net/metadata/rollbacks/8.0.61.json, which solves my issue.

UPDATE: looks like the maui team have now blocked public access to the rollback url. It seems like there is now an official way to pin maui workload version, but I've not yet tried it: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-workload-sets

Sign up to request clarification or add additional context in comments.

1 Comment

This actually solved error CS1705: Assembly 'Microsoft.Maui' with identity 'Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.iOS, Version=17.2.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' which has a higher version than referenced assembly 'Microsoft.iOS' with identity 'Microsoft.iOS, Version=17.0.0.0, Culture=neutral error
0

Are you sure you didn't update your .NET MAUI version in the NuGets? I see you mention you didn't.

Or otherwise the workload probably got updated on the hosted build agent. It might be a good idea to pin all the versions there so that won't happen again.

Along the same lines you should be able to now update to .NET MAUI version 8.0.80 that has a fix for "The name 'Resources' is reserved and cannot be used".

In your .NET MAUI csproj file add or update:

<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.80" />

You will then probably also need a reference to Microsoft.Extensions.Configuration keep that in line with the major version, so for .NET 8, add:

<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />

Here is the relevant PR that links to the issue and other relevant information.

10 Comments

Maui version isn't explicity set in the csproj, should it be? I read here that <MauiVersion></MauiVersion> shouldn't be used. I have my maui controls package reference as so <PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
Specifying $(MauiVersion) will use the version that is provided by the workload, so that will update automatically and might not match whatever you have locally. Replace $(MauiVersion) with 8.0.80 which is the latest at the time of writing and I think your should be in a much better place. Indeed forget about <MauiVersion/> shouldn't need that.
Is there anyway I can control the version of the maui workload that gets installed? A quick google suggests I cannot. I would ideally want pin the maui version in the pipeline until we have had a chance to test newer versions. This is prod pipeline for a customer facing app. I want to have a pipeline that builds with a specific version until we decide we want to move to a newer version. It seems that it could be the upgrade of maui workload that is causing my issues. Last successful build was 8.0.6, last build as of yesterday was 8.0.7.
@IeuanGriffiths, Maybe, you can try to use a self-hosted agent to run the pipeline job. Since the self-hosted agent is installed on the machine owned by you, you can manually download and install the tools/software with the specified versions on the machine.
Thanks for the suggestion - it's something I can look into for the longer term future, but for the immediate future it sounds like I'm just going to have to live with this behaviour with the microsoft hosted agent. I have managed to get around the maui build error, the only problem outstanding is the ITMS-90078 warning in app store connect.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.