【问题标题】:ServiceStack: nuget installation of OrmLite does not install all the pieces needed?ServiceStack:OrmLite 的 nuget 安装没有安装所有需要的部件?
【发布时间】:2013-04-05 00:00:01
【问题描述】:

按照文档安装包并尝试了一个简单的查询

db.SingleOrDefault<Customer>("Id={0}",id)

出现错误

无法从 程序集'ServiceStack.Text,版本=3.9.26.0,文化=中性, PublicKeyToken=null'.":"ServiceStack.Text.PlatformExtensions"}

nuget 定义是否缺失?

【问题讨论】:

    标签: ormlite-servicestack


    【解决方案1】:

    您正在引用旧的 NuGet 包。所有 ServiceStack NuGet 包 (inc ServiceStack.Text) 的当前版本是 v3.9.43。

    清除旧的 NuGet 包并重新引用它们。

    【讨论】:

    • 在我的例子中,ServiceStack.Text 只是 ServiceStack.OrmLite 的一个依赖项。不知何故,OrmLite 是正确的版本,但 .Text 不是,我从引用中手动删除了 .Text (无法从管理 nuget 包中删除它,因为它被列为 .OrmLite 的依赖项)。然后我去了解决方案-> 管理 nuget 包并添加了 .Text 并且它添加了正确的那个。不确定这是否是正确的顺序,但它在我的情况下有效,不知道为什么 3-4 个包是正确的版本而 1 个不是。
    猜你喜欢
    • 2020-06-23
    • 2016-11-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多