c# - 使用 FluentValidation 的 Release Build 得到错误

标签 c# build fluentvalidation

我将我的项目构建为 Debug模式,FluentValidation 是我的库的一部分没问题

当我在 Debug模式下构建我的项目时,一切都是成功的 但是当我使用 Release模式时,找不到 FluentValidation !!!

但是当改成Release模式时 FluentValidation Not found !!!未找到 AbstractValidator,出现错误!

The type or namespace name 'FluentValidation' could not be found (are you missing a using directive or an assembly reference?)

The type or namespace name 'AbstractValidator' could not be found (are you missing a using directive or an assembly reference?)

我一般不需要了解 Release 与 Debug 模式,我需要知道为什么 FluentValidation 不在 Release模式下构建(我想发布我的 WCF 主机,但我遇到了问题)

为什么 ??

使用 FluentValidation 库的 Release 和 Debug 模式有何不同?

最佳答案

出于某种原因,您需要从 Debug模式更改为 Release模式,然后通过包管理器控制台重新安装 Fluent,即 PM> install-package FluentValidation

无论如何这对我有用。

关于c# - 使用 FluentValidation 的 Release Build 得到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23422661/

相关文章:

c# - 创建一个新的 MailAddress 会产生 "The specified string is not in the form required for an e-mail address",尽管它的格式是正确的

c# - Resharper 无法识别正确的 ViewModel 类型

java - JUnit 测试在 Ant 中失败,任务为 `<junit>`,但通过 `<exec>` 任务?

java - 如何在Ant的build.xml中指定<java jar ="sth.jar"fork ="true"/>的输入参数?

c# - DateTime 的 Razor DisplayFor = 输入字符串的格式不正确

c# - 在 C# 中实现接口(interface)与显式实现接口(interface)

deployment - javax.security.auth.login.LoginException : unable to find LoginModule class: org. jboss.security.ClientLoginModule

c# - 如何使用 lambda 表达式进行验证以验证某个小时是否为某个 "type"(必须为 hh :00 or hh:30)

c# - 在 MediatR 管道上使用多个 FluentValidator

asp.net-mvc - 如何防止 Fluent Validation 在特定条件下验证模型