【问题标题】:Cannot Notarize .net core app for macOS usage无法公证 .net 核心应用程序以供 macOS 使用
【发布时间】:2021-08-05 14:22:45
【问题描述】:

我正在尝试对我的 .net 核心应用程序进行公证以在 MacOS 设备中运行,当我对其进行公证时,我收到了错误

可执行文件未启用强化运行时

如果我将 --options=runtime 标志添加到我的签名操作中,我的控制台应用程序将停止工作。我在 dotnet 文档中发现您必须将以下权利添加到您的应用程序主机。

  • com.apple.security.cs.allow-jit
  • com.apple.security.cs.allow-unsigned-executable-memory
  • com.apple.security.cs.allow-dyld-environment-variables
  • com.apple.security.cs.disable-library-validation

但我不知道在哪里添加它们,我尝试在我的输出目录中添加一个 entitlements.plist 文件,其中包含以下内容:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>com.apple.security.cs.allow-jit</key>
      <true/>
    <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
      <true/>
    <key>com.apple.security.cs.allow-dyld-environment-variables</key>
      <true/>
    <key>com.apple.security.cs.disable-library-validation</key>
      <true/>
  </dict>
</plist>

但还是失败了。这是我必须添加到发布过程中的内容吗?

【问题讨论】:

    标签: c# .net-core notarize dotnet-publish


    【解决方案1】:

    解决方案是在签署代码时使用entitlements.plist:

    codesign --timestamp --sign "CERTNAME" FILENAME --options=runtime --no-strict --entitlements entitlements.plist
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-03-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-12
      • 1970-01-01
      • 2020-12-26
      • 2021-06-02
      相关资源
      最近更新 更多