C# MonoMac应用程序中的JSON.NET不';Don’不要让我构建mac应用程序包

C# MonoMac应用程序中的JSON.NET不';Don’不要让我构建mac应用程序包,c#,.net,json,mono,monomac,C#,.net,Json,Mono,Monomac,我正在尝试构建使用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 "Office

我正在尝试构建使用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
将Mono合并到应用程序包中
/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/odwsyncapapplication/OfficeDrop.Sync.Business/bin/Release/OfficeDrop.Sync.Business.dll”-“/Users/mauricio/projects/mono/winclient/odwsyncapapplication/OfficeDrop.Sync.Common/bin/Release/OfficeDrop.Sync.Common.dll”-a”/Library/Frameworks/mono.framework/Versions/2.10.9/mono/Versions/2.10.9/lib/4.0/System.Xml.dll”-”/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/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/monommac.dll”“/Users/mauricio/projects/mono/winclient/odwsyncapapplication/OfficeDrop.Sync.Mac/bin/Release/OfficeDropSync.exe”
无法链接程序集:Mono.Cecil.ResolutionException:无法解析System.Void Newtonsoft.Json.JSONObject属性::.ctor(Newtonsoft.Json.MemberSerialization)
在:0中的Mono.Linker.Steps.MarkStep.MarkMethod(Mono.Cecil.MethodReference)[0x00000]处
在:0中的Mono.Linker.Steps.MarkStep.MarkCustomAttribute(Mono.Cecil.CustomAttribute ca)[0x00000]处
位于:0中的Mono.Linker.Steps.MarkStep.MarkCustomAttributes(ICCustomAttributeProvider提供程序)[0x00000]
在:0中的Mono.Linker.Steps.MarkStep.MarkType(Mono.Cecil.TypeReference参考)[0x00000]处
在:0中的Mono.Linker.Steps.MarkStep.MarkType(Mono.Cecil.TypeReference参考)[0x00000]处
位于:0中的Mono.Linker.Steps.MarkStep.MarkField(Mono.Cecil.FieldReference)[0x00000]
在:0中的Mono.Linker.Steps.MarkStep.MarkFields(Mono.Cecil.TypeDefinition类型)[0x00000]处
在:0中的Mono.Linker.Steps.MarkStep.ApplyPreserveInfo(Mono.Cecil.TypeDefinition类型)[0x00000]处
在:0中的Mono.Linker.Steps.MarkStep.MarkType(Mono.Cecil.TypeReference参考)[0x00000]处
在:0中的Mono.Linker.Steps.MarkStep.InitializeType(Mono.Cecil.TypeDefinition类型)[0x00000]处
在:0中的Mono.Linker.Steps.MarkStep.InitializeAssembly(Mono.Cecil.AssemblyDefinition assembly)[0x00000]处
在0中的Mono.Linker.Steps.MarkStep.Initialize()[0x00000]处
在:0中的Mono.Linker.Steps.MarkStep.Process(Mono.Linker.LinkContext上下文)[0x00000]处
在0中的Mono.Linker.Pipeline.Process(Mono.Linker.LinkContext上下文)[0x00000]处
在MonoMac.Tuner.Linker.Run(Mono.Linker.Pipeline,Mono.Linker.LinkContext上下文)[0x00000]处,0未能链接/Users/mauricio/projects/Mono/winclient/odwsyncapapplication/OfficeDrop.Sync.Mac/bin/Release/OfficeDropSync.exe
mmp已退出,代码为1
以前有人见过这个吗?有办法解决这个问题吗

以前有人见过这个吗

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

在您的例子中,您的
mmp
命令行似乎没有任何对json程序集的直接引用。但是,某些程序集具有对它的引用。当处理后者时,以及当
mmp
解析程序无法找到引用的程序集时,会发生
ResolutionException

有办法解决这个问题吗

手动添加对程序集的引用(确保将其包含在内)或确保可以通过
mmp
找到它(缺少的json库)

以前有人见过这个吗

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

在您的例子中,您的
mmp
命令行似乎没有任何对json程序集的直接引用。但是,某些程序集具有对它的引用。当处理后者时,以及当
mmp
解析程序无法找到引用的程序集时,会发生
ResolutionException

有办法解决这个问题吗


手动添加对程序集的引用(确保包含该程序集)或确保可以通过
mmp

找到该程序集(缺少的json库),我已将json.NET项目源代码作为单独的项目包含在我的项目中,并包含在MonoMac项目中,因此,它有一个直接的参考。你确定其他程序集(主要是预编译的程序集)都没有寻找单独的库吗?是的,没有预编译的二进制文件,我昨天删除了唯一可用的一个,现在我们只有源项目。有些东西(已加载)具有对找不到的内容的引用。你需要找出它是什么。查看提供给
mmp
的程序集列表,并将其与您构建的程序集进行比较。这两个列表是相同的(对照旧的二进制文件仔细检查路径)?MonoMac链接器正在制作一些魔术,并从我的类(以及库源代码)中删除属性。由于我没有找到解决方法,我只是删除了JSON.NET,并决定使用另一个不使用注释的解析器,这并不理想,但这就是生活。我已经将JSON.NET项目源代码作为单独的项目包含在我的项目中,并包含在MonoMac项目中,因此,它有一个直接引用。你确定其他程序集(主要是任何预编译的程序集)都没有寻找单独的库吗?是的,没有预编译的二进制文件,我昨天删除了唯一可用的一个,现在我们只有源项目。某些(加载的)程序集引用了一些无法使用的程序集