ikvmnet / ikvm

A Java Virtual Machine and Bytecode-to-IL Converter for .NET
Other
1.17k stars 110 forks source link

IKVM.MSBuild.Tasks.IkvmTaskMessageException is not serializable #392

Closed CFY2436 closed 11 months ago

CFY2436 commented 1 year ago

大佬,在VS引用,运行时报错咯 UNHANDLED EXCEPTIONS FROM PROCESS 28032:

2023/7/21 14:43:08 System.Runtime.Serialization.SerializationException: 程序集“IKVM.MSBuild.Tasks, Version=8.6.2.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58”中的类型“IKVM.MSBuild.Tasks.IkvmTaskMessageException”未标记为可序列化。 在 System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder) 在 System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder) 在 System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) 在 System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) 在 Microsoft.Build.BackEnd.BinaryTranslator.BinaryWriteTranslator.TranslateDotNet[T](T& value) 在 Microsoft.Build.BackEnd.TaskHostTaskComplete.Translate(ITranslator translator) 在 Microsoft.Build.BackEnd.NodeEndpointOutOfProcBase.RunReadLoop(Stream localReadPipe, Stream localWritePipe, ConcurrentQueue`1 localPacketQueue, AutoResetEvent localPacketAvailable, AutoResetEvent localTerminatePacketPump)

wasabii commented 11 months ago

IKVM.MSBuild.Tasks.IkvmTaskMessageException can be thrown from the custom task. However, it needs to cross an AppDomain boundary on .NET Framework, and thus needs to be serializable.

wasabii commented 11 months ago

This serialization problem should be fixed in the 8.6.3-pre.11 release building now.