我必须遵循YamlDotNet文档https://dotnetfiddle.net/QlqGDV中的代码
using System.Collections.Generic;
using System.IO;
using System;
using YamlDotNet.Serialization;
public class ALogger {
public function writeFile() {
using (var sw = new StreamWriter(_logFileCasesPath + @"\" + _logCaseName))
{
var ser = new Serializer();
ser.Serialize(sw, _logCase);
}
}
}但是新的序列化程序抛出了这个异常,我不知道为什么。我没有找到该异常消息的任何提示。
Ein Ausnahmefehler des Typs "System.MissingMethodException" ist in InnoTest.exe aufgetreten.
Zusätzliche Informationen: Methode nicht gefunden: "Void YamlDotNet.Serialization.Serializer..ctor(YamlDotNet.Serialization.SerializationOptions, YamlDotNet.Serialization.INamingConvention, YamlDotNet.Serialization.YamlAttributeOverrides)".发布于 2016-08-19 17:46:31
另一个使用的框架已经在3.8版本中包含了YamlDotNet,但我使用的是3.9,因此存在冲突,但编译器找不到它。只有在运行时才有异常。
Cleanupedit:我设法让这两个库达到了相同的版本,但它是有效的。然后,我与nuget包的开发人员进行了交谈,让他们使用nuget特性进行正确的依赖项管理。
https://stackoverflow.com/questions/39020247
复制相似问题