【问题标题】:FhirSerializer to Json and XMLFhirSerializer 到 Json 和 XML
【发布时间】:2019-05-31 16:13:59
【问题描述】:

我必须将我的库升级到 Hl7.Fhir.Serialization 3.5.0.2,但现在我收到 Newtonsoft.Json 版本 11 错误。看起来 Hl7.Fhir.Serialization 还必须将 Newtonsoft.Json 库更新到 12.0.0。

知道为什么会出现此错误吗?

过时

//var result = format == Format.Json 
//    ? FhirSerializer.SerializeResourceToJson(exportModel, SummaryType.False)
//    : FhirSerializer.SerializeResourceToXml(exportModel, SummaryType.False);

改为

var FhirJson = new FhirJsonSerializer();
var FhirXML = new FhirXmlSerializer();


            var result =
                format == Format.Json
                ? FhirJson.SerializeToString(exportModel, SummaryType.False)
                : FhirXML.SerializeToString(exportModel, SummaryType.False);

我遇到的错误

无法加载文件或程序集 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'

我尝试的解决方案是更改 web.config 文件,但没有修复它

<dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="12.0.0.0"/>
</dependentAssembly>

【问题讨论】:

标签: c# hl7-fhir


【解决方案1】:

现在我已经更新了 oldVersion="0.0.0.0-9.0.0.0" newVersion="12.0.0.0"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-06-11
    • 2018-05-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多