【问题标题】:Problems signing a dll in F# on Mono在 Mono 上用 F# 签名 dll 时出现问题
【发布时间】:2011-04-13 14:04:23
【问题描述】:

我在尝试在单声道上使用 F# 签名 dll 时遇到错误:

$ mono /usr/local/share/FSharp-2.0.0.0/bin/fsc.exe\
   --target:library \
   --keyfile:../../external/MyKeyFile.snk\
   AssemblyInfo.fs\
   ../../fs/FooBar.fs\  
   -o:FooBar.dll

没有生成 dll,我得到了这个错误:

Microsoft (R) F# 2.0 Compiler build 2.0.0.0 Copyright (c) Microsoft Corporation. All Rights Reserved.`

error FS2014: A problem occurred writing the binary '': A call to StrongNameGetPublicKey failed (mscoree.dll)`

密钥文件是在 Windows 中生成的,这有什么不同吗?

更新:

使用 Mono 2.6.4

$ mono --version 

Mono JIT compiler version 2.6.4 (tarball Mon Jun 21 19:26:21 UTC 2010) 
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
TLS:           __thread
GC:            Included Boehm (with typed GC and Parallel Mark)
SIGSEGV:       altstack
Notifications: epoll
Architecture:  amd64
Disabled:      none

【问题讨论】:

  • 您使用的是哪个版本的 Mono? (你可以通过 mono --version 找到)
  • @Edgar,我已将信息添加到问题中。

标签: f# mono assembly-signing


【解决方案1】:

生成程序集后尝试使用 sn 进行签名。

为此,您首先需要使用--delaysign flag 进行编译以生成延迟签名的程序集。

之后您可以使用带有 -R 标志的 sn 实用程序对程序集进行签名。

我不能 100% 确定这会起作用,因为我没有 Linux 或 Mac 机器来测试它。不过值得一试。

【讨论】:

  • 我已经看过但无法弄清楚如何签署以前未签名的程序集...欢迎任何指针...
  • 我添加了更多信息。希望这会有所帮助。
【解决方案2】:

看起来 fsc 是 P/Invoking 本机 Windows API,不可移植。您应该向 F# 团队提出这个问题。

【讨论】:

  • @Benjol:你听到什么了吗?
  • @mmacaulay,不是真的,我想我在“内部”邮件上被复制,说他们会尝试调查。我怀疑它位于 Microsoft 和 Mono 之间的无人区……但如果/当我确实听到任何消息时,我会在这里发帖。
猜你喜欢
  • 2015-01-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-06-10
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多