JSON.NET MonoMac 应用程序中不允许我构建 mac 应用程序包
本文关键字:应用程序 构建 mac 允许我 NET MonoMac JSON 不允许 | 更新日期: 2023-09-27 18:34:54
我正在尝试构建一个使用 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
以前有人见过吗?有没有办法解决这个问题?
以前有人见过吗?
是的。当无法解析符号时,会发生这种情况。
在您的情况下,您的mmp
命令行似乎没有任何对 json 程序集的直接引用。但是,某些程序集具有对它的引用。处理后mmp
解析程序找不到引用的程序集时,会发生ResolutionException
。
有没有办法解决这个问题?
手动添加对程序集的引用(这将确保它将被包含(或确保它(缺少的 json 库(可以通过 mmp
找到。