How to notarize dotnet with binary package install on mac

li V 0 Reputation points
2024-03-07T09:54:56.01+00:00

I download the binary package of dotnot8 and dotnet7 , when I run ./dotnet --version, I get this issus:

“Microsoft.NETCore.App.app” is damaged and can’t be opened. You should move it to the Trash.

there is detail:

./dotnet -version              

Failed to load /Users/vli/Downloads/dotnet-sdk-8.0.201-osx-arm64/shared/Microsoft.NETCore.App/8.0.2/libhostpolicy.dylib, error: dlopen(/Users/vli/Downloads/dotnet-sdk-8.0.201-osx-arm64/shared/Microsoft.NETCore.App/8.0.2/libhostpolicy.dylib, 0x0001): tried: '/Users/vli/Downloads/dotnet-sdk-8.0.201-osx-arm64/shared/Microsoft.NETCore.App/8.0.2/libhostpolicy.dylib' (code signature in <D739C41A-0AEA-3B86-81F0-946F015399C3> '/Users/vli/Downloads/dotnet-sdk-8.0.201-osx-arm64/shared/Microsoft.NETCore.App/8.0.2/libhostpolicy.dylib' not valid for use in process: library load disallowed by system policy), '/System/Volumes/Preboot/Cryptexes/OS/Users/vli/Downloads/dotnet-sdk-8.0.201-osx-arm64/shared/Microsoft.NETCore.App/8.0.2/libhostpolicy.dylib' (no such file), '/Users/vli/Downloads/dotnet-sdk-8.0.201-osx-arm64/shared/Microsoft.NETCore.App/8.0.2/libhostpolicy.dylib' (code signature in <D739C41A-0AEA-3B86-81F0-946F015399C3> '/Users/vli/Downloads/dotnet-sdk-8.0.201-osx-arm64/shared/Microsoft.NETCore.App/8.0.2/libhostpolicy.dylib' not valid for use in process: library load disallowed by system policy)

An error occurred while loading required library libhostpolicy.dylib from [/Users/vli/Downloads/dotnet-sdk-8.0.201-osx-arm64/shared/Microsoft.NETCore.App/8.0.2]

How can I solve it.

Developer technologies C#
{count} votes

2 answers

Sort by: Most helpful
  1. li V 0 Reputation points
    2024-03-08T05:51:22.7833333+00:00

    I can't find the open anyway tips in Security & Privacy-General and the dotnet bash run normal when I execute with this commond ./dotnet:

    ->
    Usage: dotnet [options]
    Usage: dotnet [path-to-application]
    Options:
      -h|--help         Display help.
      --info            Display .NET information.
      --list-sdks       Display the installed SDKs.
      --list-runtimes   Display the installed runtimes.
    path-to-application:
      The path to an application .dll file to execute.
    

    the issus only happen when dotnet use the file in dotnet-sdk-8.0.201-osx-arm64/shared/Microsoft.AspNetCore.App.app/ and dotnet-sdk-8.0.201-osx-arm64/shared/Microsoft.NETCore.App.app/

    the icon of these two floder like this:

    Screenshot 2024-03-08 at 13.48.21

    I open it with this issus:

    You can’t open the application “Microsoft.NETCore.App.app” because it may be damaged or incomplete.
    

    and show package contents can open it

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.