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

[BUG] CS8012 on publish net8.0-ios #3190

Closed
tibuprophen opened this issue Jul 17, 2024 · 7 comments
Closed

[BUG] CS8012 on publish net8.0-ios #3190

tibuprophen opened this issue Jul 17, 2024 · 7 comments

Comments

@tibuprophen
Copy link

tibuprophen commented Jul 17, 2024

Description

Recently, we upgraded our iOS and Android Maui App from Prism 8 to 9. After clearing out some changes, we've noticed that our ci pipeline for publishing is failing. After a short investigation, our pipeline failed due to a CS8012 thrown at Prism.Maui.
CSC : warning CS8012: Die Assembly "Prism.Maui, Version=9.0.401.20976, Culture=neutral, PublicKeyToken=null", auf die verwiesen wird, hat einen anderen Zielprozessor. [/Users/tibo/temp/PrismTest/PrismTest.csproj::TargetFramework=net8.0-ios]
Sorry for german localization, but the issue should be clear.

I have also found the discussion topic here: #3102 where other people recently discovered the same bug.

The bug is not affecting android and debug buiilds are working e.g. on simulator. The build does not fail as long as no TreatWarningsAsErrors is set.

Steps to Reproduce

  1. dotnet new maui -n PrismTest
  2. cd PrismTest
  3. dotnet add package Prism.DryIoc.Maui --version 9.0.401-pre
  4. For dotnet publish on ios, you may need a valid profile for an app identifier. So I changed the ApplicationId in PrismTest.csproj to an application I have a profile for installed.
  5. Add prism usage in app e.g. by adding .UsePrism(x => x.CreateWindow(y => y.CreateBuilder().AddSegment<MainPage>())) at the end of the MauiAppBuilder in MauiProgram.cs
  6. dotnet publish --framework net8.0-ios

Platform with bug

.NET MAUI

Affected platforms

iOS

Did you find any workaround?

Because this is a warning, no workaround is required, unless you are using TreatWarningsAsErrors. Then add <NoWarn>$(NoWarn);CS8012</NoWarn> to the csproj.

Relevant log output

Determining projects to restore...
  "/Users/xxx/temp/PrismTest/PrismTest.csproj" wiederhergestellt (in 1,24 Sek.).
  Detected signing identity:
          
    Code Signing Key: "Apple Development: XXXX" (XXX)
    Provisioning Profile: "match Development xxxxx" (XXX)
    Bundle Id: xxx
    App Id: xxx
CSC : warning CS8012: Die Assembly "Prism.Maui, Version=9.0.401.20976, Culture=neutral, PublicKeyToken=null", auf die verwiesen wird, hat einen anderen Zielprozessor. [/Users/xxx/temp/PrismTest/PrismTest.csproj::TargetFramework=net8.0-ios]
  PrismTest -> /Users/xxx/temp/PrismTest/bin/Release/net8.0-ios/ios-arm64/PrismTest.dll
  Das Optimieren der Assembly für die Größe kann das Verhalten der App ändern. Stellen Sie sicher, dass nach der Veröffentlichung Tests durchgeführt werden. Informationen finden Sie unter https://aka.ms/dotnet-illink.
  Assemblys werden für die Größe optimiert. Dieser Vorgang kann eine Weile dauern.
  Created the package: bin/Release/net8.0-ios/ios-arm64/publish//PrismTest.ipa
@dansiegel
Copy link
Member

This was fixed a long time ago

@DonkeyKongJr
Copy link

@dansiegel when was this fixed?

@dansiegel
Copy link
Member

if I remembered that I wouldn't have just said a long time ago

@DonkeyKongJr
Copy link

Ok. I was just wondering since the error occurred with version “9.0.401” and AFAIK there wasn't a new version since.

@dansiegel
Copy link
Member

Those with a Commercial Plus license had access to this quite a while ago. I believe it was shortly after 401 shipped. Keep in mind any bug fixes we do only get back ported for Commercial Plus users. Everyone else has to wait until we do a 9.1 preview publicly.

@DonkeyKongJr
Copy link

Thanks for clarification, I wasn't aware of that to be honest.

@dansiegel
Copy link
Member

@DonkeyKongJr I would say that most companies are opting to go with the Commercial Plus license not only for all of the extras that you get but also because of the more frequent access to bug fixes. Public channels will be infrequently updated where the private channels are updated as soon as the CI finishes building as we merge fixes and features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants