I have read heaps of advice and related problems, but haven't stumbled upon exact one that troubles me. The problem is straightforward: I have a console app written in .Net Core 3.1, which I would like to distribute to MacOS, among others. Hence, I need an installer. Ideally, the whole process shall be script-based, no clicking. Yep, CI. My steps:
dotnet publish -c Release -r osx-x64(when done on Windows, I add thechmod +xto allow execution - no caveat here)- pack the whole
bin/Release/osx-x64/publishdirectory into an.appfile (using Platypus for now just to make sure the whole.appthing is valid). At this point, clicking on the app actually runs it as expected (apart from the Untrusted developer warning). - I have a valid 3rd Party Mac Developer Application certificate, which I use to sign the
.appand all files within (using a simple script). My entitlements are scarce (basically just the ones listed in Microsoft documentation). codesign -vvv --deep-verify MyApp.appreturns nicevalid on diskandsatisfies its Designated Requirements- Another script then compresses the
.appinto a.ziparchive and uploads it for notarization, which fails. Reason:Invalid package. Runningspctl -vvv --assess --type exec MyApp.appreturnsrejected, so no surprise.
I have learnt that Invalid package may mean almost anything, as it just don't passes a whitelist of allowed stuff and it is not really possible to indicate where it got wrong (would have to list a rejection reason for each and every rule).
It might be insufficient set of entitlements, as my list only contains the 'default' values per MS documentation. However, I have also tried to create a simple Hello world console app to minimize anything going on inside - and sure, Invalid package. So it shouldn't be that my app is trying to do something that is not listed in the entitlements.
Which leaves us for... Hardened Runtime is not enabled? I haven't found any explicit way to enable it in .net core console app (the only reference was for Xamarin.Mac, which is not applicable here IMO). Neither a way to verify that this is the problem indeed. But I don't expect MS to put so much effort into making .net core cross-platform and then throwing it all away just because Apple mandates Hardened Runtime.
I have tried building on both Windows and Mac, no help. My "Mac" is 10.15 Catalina in a VM (could this be an issue?).
Can anyone please help me, set me on a correct path or show me some piece of documentation I have been missing? I cannot believe that it is impossible.
Thank you.