1

我正在尝试构建一个使用 JSON.NET 库的 MonoMac 应用程序,但每当我尝试生成应用程序安装程序时,我都会看到以下错误:

Merging Mono into app bundle
    /Applications/Development/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/MonoDevelop.MonoMac/mmp -o "/tmp/monomac-build-634732855752481110" -n "OfficeDropSync" -a  "/Users/mauricio/projects/mono/winclient/ODWSyncApplication/OfficeDrop.Sync.Business/bin/Release/OfficeDrop.Sync.Business.dll" -a "/Users/mauricio/projects/mono/winclient/ODWSyncApplication/OfficeDrop.Sync.Common/bin/Release/OfficeDrop.Sync.Common.dll" -a "/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.dll" -a "/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Xml.dll" -a "/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Core.dll" -a "/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Xml.Linq.dll" -a "/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/System.Drawing.dll" -a "/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/Mono.Data.Sqlite.dll" -a "/Users/mauricio/projects/mono/winclient/thirdparty/log4net.dll" -a "/Users/mauricio/projects/mono/winclient/thirdparty/monomac/src/MonoMac.dll" "/Users/mauricio/projects/mono/winclient/ODWSyncApplication/OfficeDrop.Sync.Mac/bin/Release/OfficeDropSync.exe"
Could not link assemblies: Mono.Cecil.ResolutionException: Failed to resolve System.Void Newtonsoft.Json.JsonObjectAttribute::.ctor(Newtonsoft.Json.MemberSerialization)
  at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.MarkCustomAttribute (Mono.Cecil.CustomAttribute ca) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.MarkCustomAttributes (ICustomAttributeProvider provider) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.MarkType (Mono.Cecil.TypeReference reference) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.MarkType (Mono.Cecil.TypeReference reference) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.MarkField (Mono.Cecil.FieldReference reference) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.MarkFields (Mono.Cecil.TypeDefinition type) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.ApplyPreserveInfo (Mono.Cecil.TypeDefinition type) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.MarkType (Mono.Cecil.TypeReference reference) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.InitializeType (Mono.Cecil.TypeDefinition type) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.InitializeAssembly (Mono.Cecil.AssemblyDefinition assembly) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.Initialize () [0x00000] in <filename unknown>:0 
  at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0 
  at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0 
  at MonoMac.Tuner.Linker.Run (Mono.Linker.Pipeline pipeline, Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0 Failed to link /Users/mauricio/projects/mono/winclient/ODWSyncApplication/OfficeDrop.Sync.Mac/bin/Release/OfficeDropSync.exe

mmp exited with code 1

有没有人见过这个?有没有办法解决这个问题?

4

1 回答 1

1

有没有人见过这个?

是的。当符号无法解析时会发生这种情况。

在您的情况下,您的mmp命令行似乎没有对 json 程序集的任何直接引用。然而,一些程序集引用了它。ResolutionException当处理后者以及mmp解析器无法找到引用的程序集时会发生这种情况。

有没有办法解决这个问题?

手动添加对程序集的引用(这将确保包含它)确保它(缺少的 json 库)可以通过mmp.

于 2012-05-22T17:58:30.073 回答