【发布时间】:2019-05-03 21:43:53
【问题描述】:
我刚刚开始研究一个在 4.6.2 中运行的 ASPNET 项目。代码下载、构建和运行良好(VS2019 社区),但我收到大量这样的警告:
CS0436 The type 'UserModel' in '...\Crm\App_Code\Models\UserModel.cs' conflicts with the imported type 'UserModel' in 'Crm, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in '...\Crm\App_Code\Models\UserModel.cs'.
无法理解此引用是如何复制自身的。这是我的代码库中一次定义的类型。只有一个构建程序集。没有重复的声明(如 this post )。就像该项目以某种方式引用了自己构建的程序集并感到困惑。这是一些奇怪的 ASPNET 魔法吗?
有趣的是,如果我在 VS2017 专业版中构建它,这些会显示为 CS0012 错误,但不会阻止项目构建或运行。
有人可以帮助了解正在发生的事情还是更好地清除这些警告/错误?
【问题讨论】:
-
是的,它根本不是重复的。那些人在声明重复类型,这在我的情况下没有发生。我已经编辑了问题以反映它。
标签: c# asp.net-mvc .net-framework-version