Search code examples
c#.netblazormauimaui-blazor

How to fix .NET MAUI Blazor Hybrid app code object is not signed at all issue in Mac M2 when Building for iOS?


I created .NET MAUI application for ERP purpose. currently it deploying to android and windows as well and those are working fine. we started it from .NET 7 and currently we are using .NET 8 as well.

here is description of my environment. for iOS I tried to build using iOS using XCode latest and dotnet 8 for mac arm64 devices and apple m2 MacBook as well. but I cannot directly connect my MacBook and windows pc. there are too much lessons for develop by connecting windows and MacBook.

I tried to build it from MacBook itself. it seems working but I got error below. I need to fix that but I couldn't find any way to fix that.

   

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8078/tools/msbuild/iOS/Xamarin.Shared.targets(2257,3): error : /usr/bin/codesign exited with code 1: [<Project_path>/bluelotus360.com.mauiBlazor.csproj::TargetFramework=net8.0-ios] 

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8078/tools/msbuild/iOS/Xamarin.Shared.targets(2257,3): error : <Project_path>/bin/Release/net8.0-ios/ios-arm64/bluelotus360.com.mauiBlazor.app: code object is not signed at all [<Project_path>/bluelotus360.com.mauiBlazor.csproj::TargetFramework=net8.0-ios] 

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8078/tools/msbuild/iOS/Xamarin.Shared.targets(2257,3): error : In subcomponent: <Project_path>/bin/Release/net8.0-ios/ios-arm64/bluelotus360.com.mauiBlazor.app/System.Xml.Linq.dll [<Project_path>/bluelotus360.com.mauiBlazor.csproj::TargetFramework=net8.0-ios] 

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8078/tools/msbuild/iOS/Xamarin.Shared.targets(2257,3): error : Failed to codesign '<Project_path>/bin/Release/net8.0-ios/ios-arm64/bluelotus360.com.mauiBlazor.app': <Project_path>/bin/Release/net8.0-ios/ios-arm64/bluelotus360.com.mauiBlazor.app: code object is not signed at all [<Project_path>/bluelotus360.com.mauiBlazor.csproj::TargetFramework=net8.0-ios] 

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8078/tools/msbuild/iOS/Xamarin.Shared.targets(2257,3): error : In subcomponent: <Project_path>/bin/Release/net8.0-ios/ios-arm64/bluelotus360.com.mauiBlazor.app/System.Xml.Linq.dll [<Project_path>/bluelotus360.com.mauiBlazor.csproj::TargetFramework=net8.0-ios] 

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8078/tools/msbuild/iOS/Xamarin.Shared.targets(2257,3): error :  [<Project_path>/bluelotus360.com.mauiBlazor.csproj::TargetFramework=net8.0-ios] 

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8078/tools/msbuild/iOS/Xamarin.Shared.targets(2257,3): error :          [<Project_path>/bluelotus360.com.mauiBlazor.csproj::TargetFramework=net8.0-ios] 


here is terminal code I used

dotnet publish -f net8.0-ios -c Release

There is a guide to verify certificate taken from apple.

Blog Post I used then it shows as verified certificate in keychain.

are there any other workaround?


Solution

  • From the docs: Publish a .NET MAUI app, you must have a Mac and an Apple Developer Program to create an App Store distribution provisioning profile.

    For more information, please refer to Publish a .NET MAUI iOS app for App Store distribution - .NET MAUI | Microsoft Learn and Publish an iOS app using the command line.