My .net MAUI app works in debug mode, but "dotnet publish" doesn't work

40 Views Asked by At

I am in the process of migrating my Xamarin.IOS app to .NET MAUI. I was able to migrate, and so far, so good here on the simulator, but when I try to publish my .IPA file to deploy to test flight, it doesn't work.

- The dontet cli command that I'm using:

dotnet publish -f net7.0-ios -c Release -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64 -p:CodesignKey="MY-KEY" -p: CodesignProvision="MY-PROFILE"

- The error is this: ILLink : error IL1040: Failed to resolve System.Security.Permissions.FileIOPermissionAccess. [/Users/kaioteles/Documents/Repositorios/DataArt/ArtBinder/ArtbinderMobile/ArtBinder64/ArtBinder.csproj] Fatal error in IL Linker Unhandled exception. Mono.Cecil.ResolutionException: Failed to resolve System.Security.Permissions.FileIOPermissionAccess at Mono.Cecil.Mixin.CheckedResolve(TypeReference self) at Mono.Cecil.SignatureReader.ReadCustomAttributeEnum(TypeReference enum_type) at Mono.Cecil.SignatureReader.ReadCustomAttributeElementValue(TypeReference type) at Mono.Cecil.SignatureReader.ReadCustomAttributeElement(TypeReference type) at Mono.Cecil.SignatureReader.ReadCustomAttributeFixedArgument(TypeReference type) at Mono.Cecil.SignatureReader.ReadCustomAttributeNamedArgument(Collection1& fields, Collection1& properties) at Mono.Cecil.SignatureReader.ReadCustomAttributeNamedArguments(UInt16 count, Collection1& fields, Collection1& properties) at Mono.Cecil.SignatureReader.ReadSecurityAttribute() at Mono.Cecil.MetadataReader.ReadSecurityDeclarationSignature(SecurityDeclaration declaration) at Mono.Cecil.SecurityDeclaration.<>c.b__19_0(SecurityDeclaration declaration, MetadataReader reader) at Mono.Cecil.ModuleDefinition.Read[TItem](TItem item, Action2 read) at Mono.Cecil.SecurityDeclaration.Resolve() at Mono.Cecil.SecurityDeclaration.get_HasSecurityAttributes() at Mono.Linker.TypeReferenceWalker.WalkSecurityAttributesTypesScopes(ISecurityDeclarationProvider securityAttributeProvider) at Mono.Linker.TypeReferenceWalker.WalkScopes(TypeDefinition typeDefinition) at Mono.Linker.TypeReferenceWalker.Process() at Mono.Linker.Steps.MarkStep.TypeReferenceMarker.MarkTypeReferences(AssemblyDefinition assembly, MarkingHelpers markingHelpers) at Mono.Linker.Steps.MarkStep.MarkEntireAssembly(AssemblyDefinition assembly) at Mono.Linker.Steps.MarkStep.MarkAssembly(AssemblyDefinition assembly, DependencyInfo reason) at Mono.Linker.Steps.MarkStep.MarkModule(ModuleDefinition module, DependencyInfo reason) at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference, DependencyInfo reason, Nullable1 origin) at Mono.Linker.Steps.MarkStep.MarkField(FieldDefinition field, DependencyInfo& reason, MessageOrigin& origin) at Mono.Linker.Steps.MarkStep.MarkEntireType(TypeDefinition type, DependencyInfo& reason) at Mono.Linker.Steps.MarkStep.MarkEntireType(TypeDefinition type, DependencyInfo& reason) at Mono.Linker.Steps.MarkStep.MarkEntireAssembly(AssemblyDefinition assembly) at Mono.Linker.Steps.MarkStep.MarkAssembly(AssemblyDefinition assembly, DependencyInfo reason) at Mono.Linker.Steps.MarkStep.MarkModule(ModuleDefinition module, DependencyInfo reason) at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference, DependencyInfo reason, Nullable1 origin) at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference, DependencyInfo reason, Nullable1 origin) at Mono.Linker.Steps.MarkStep.MarkGenericArguments(IGenericInstance instance) at Mono.Linker.Steps.MarkStep.GetOriginalType(TypeReference type, DependencyInfo reason) at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference, DependencyInfo reason, Nullable1 origin) at Mono.Linker.Steps.MarkStep.MarkGenericArguments(IGenericInstance instance) at Mono.Linker.Steps.MarkStep.GetOriginalType(TypeReference type, DependencyInfo reason) at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference, DependencyInfo reason, Nullable1 origin) at Mono.Linker.Steps.MarkStep.MarkGenericArguments(IGenericInstance instance) at Mono.Linker.Steps.MarkStep.GetOriginalType(TypeReference type, DependencyInfo reason) at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference, DependencyInfo reason, Nullable`1 origin) at Mono.Linker.Steps.MarkStep.MarkField(FieldDefinition field, DependencyInfo& reason, MessageOrigin& origin) at Mono.Linker.Steps.MarkStep.MarkEntireType(TypeDefinition type, DependencyInfo& reason) at Mono.Linker.Steps.MarkStep.MarkEntireType(TypeDefinition type, DependencyInfo& reason) at Mono.Linker.Steps.MarkStep.MarkEntireAssembly(AssemblyDefinition assembly) at Mono.Linker.Steps.MarkStep.MarkAssembly(AssemblyDefinition assembly, DependencyInfo reason) at Mono.Linker.Steps.MarkStep.MarkModule(ModuleDefinition module, DependencyInfo reason) at Mono.Linker.Steps.MarkStep.ProcessMarkedPending() at Mono.Linker.Steps.MarkStep.Initialize() at Mono.Linker.Steps.MarkStep.Process(LinkContext context) at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step) at Mono.Linker.Pipeline.Process(LinkContext context) at Mono.Linker.Driver.Run(ILogger customLogger) at Mono.Linker.Driver.Main(String[] args) /Users/kaioteles/.nuget/packages/microsoft.net.illink.tasks/7.0.100-1.23211.1/build/Microsoft.NET.ILLink.targets(86,5): error NETSDK1144: Falha na otimização de assemblies de tamanho. A otimização pode ser desabilitada definindo a propriedade PublishTrimmed como false. [/Users/kaioteles/Documents/Repositorios/DataArt/ArtBinder/ArtbinderMobile/ArtBinder64/ArtBinder.csproj]

Im not sure what is the problem, this is the list of all my depencencies that i use: enter image description here

I add this property on my csproj file: copyused

After this is in place, the published works, but my NewSoft.Json lib stops working, and I can't deserialize any JSON.

Is there a problem with some of my nugget's liberties? Or is it a parameter that is missing with my dotnet publish command?

0

There are 0 best solutions below