【问题标题】:Why is nancy complaining about a missing reference for System?为什么 nancy 抱怨 System 缺少参考?
【发布时间】:2016-04-25 22:09:53
【问题描述】:

我在模型中添加了 X509Certificate2 属性,现在我的 razor 视图无法编译。确切的错误信息是...

[CS0012] 行:84 列:18 - Le 类型 'System.Security.Cryptography.X509Certificates.X509Certificate2' est défini dans un Assembly qui n'est pas référencé。 Vous devez ajouter une référence à l'assembly 'System, Version=4.0.0.0, 文化=中性,PublicKeyToken=b77a5c561934e089'。 (显示)

对不起我的法语,但你明白了。

X509Certificate2 是在 System.dll 中定义的,我在项目中有对 System 的引用。

【问题讨论】:

    标签: nancy


    【解决方案1】:

    好吧,我又傻了。 razor 需要的引用需要在 web.config 中明确列出。它不要求项目参考。这一切都在“配置 Razor”部分中解释了 here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-08-12
      • 2011-08-23
      • 1970-01-01
      • 1970-01-01
      • 2020-04-08
      相关资源
      最近更新 更多