c# - 找不到 namespace 名称 'MvcSiteMapProvider'

标签 c# visual-studio visual-studio-2015 compiler-errors mvcsitemapprovider

尝试运行/调试应用程序时出现以下错误

CS0246:找不到类型或 namespace 名称“MvcSiteMapProvider”(您是否缺少using指令或程序集引用?)

在我的Web.Config文件的以下行中:

Line 179:   <pages>
Line 180:      <namespaces>
Line 181:        <add namespace="MvcSiteMapProvider.Web.Html" />
Line 182:        <add namespace="MvcSiteMapProvider.Web.Html.Models" />
Line 183:      </namespaces>
Line 184:    </pages>

据我所知,该引用存在于我的项目中。为了确保我通过以下方式从Nuget控制台中添加了它:

安装软件包MvcSiteMapProvider.Web-Project FitAchiever.Web

并且它似乎已正确安装。

如果有帮助,我在这里包括了我的web.config:My Web Config

感谢您提供的任何帮助。

最佳答案

按照description of the MvcSiteMapProvider.Web package:

This project contains extra configuration that is required by MvcSiteMapProvider during installation into a Web project as well as a starting point for XML configuration of the provider.

This package is a dependency that is automatically installed with many of the MvcSiteMapProvider packages and you will generally not need to install this package by itself.


换句话说,MvcSiteMapProvider.Web不是独立的NuGet程序包。您必须安装MvcSiteMapProvider.MVCx(其中x是您的项目的MVC版本),否则.dll未安装到您的项目中。

关于c# - 找不到 namespace 名称 'MvcSiteMapProvider',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43301543/

相关文章:

roslyn - 引用问题/缺失类型

c# - 如何创建内容文件并从控制台应用程序导航到该文件?

c# - 按降序对数组进行排序的更好方法

c# - 使用 iTextSharp 链接到 PDF

c# - 如何使用poco实体生成器

c# - 我在 Visual Studio 中的项目是只读的。我做了什么?

python - 链接 : fatal error lnk1181: cannot open input file 'id=2.obj'

c# - 使用 PetaPoco 分页映射关系

visual-studio - 每当我打开我的解决方案时,都会自动弹出 Visual Studio 单元测试 session 窗口

c# - Visual Studio 2017在连接列表中未显示MySQL