简体   繁体   English

类型或名称空间名称“ FriendlyUrls”在名称空间“ Microsoft.AspNet”中不存在

[英]The type or namespace name 'FriendlyUrls' does not exist in the namespace 'Microsoft.AspNet'

I have a simple WebForms project on VisualStudio 2013 created with standard web project wizard. 我在Visual Studio 2013上使用标准Web项目向导创建了一个简单的WebForms项目。 Recently, I ve installed VisualStudio 2015 and decided to upgrade. 最近,我已经安装了VisualStudio 2015并决定升级。 After upgrade, I ve run standard NuGet package restore, which went just fine. 升级后,我运行了标准的NuGet软件包还原,一切正常。

To my surprise the project does not build. 令我惊讶的是,该项目没有建立。 Error message is: 错误信息是:

The type or namespace name 'FriendlyUrls' does not exist in the namespace 'Microsoft.AspNet' 类型或名称空间名称“ FriendlyUrls”在名称空间“ Microsoft.AspNet”中不存在

  1. I ve looked into references section: Yes, proper reference is really missing there. 我查看了参考资料部分:是的,这里确实缺少适当的参考资料。
  2. I ve looked into installed NuGet packages: Yes, proper package is installed in place and updated to the latest version. 我研究了已安装的NuGet软件包:是的,适当的软件包已安装到位并更新为最新版本。
  3. I ve explicitly uninstalled the package with NuGet and installed it again: No change. 我已经使用NuGet明确卸载了该软件包,然后再次安装了该软件包:不变。 Error is still the same. 错误仍然相同。

In fact, I can build project successfully with 'FriendlyUrls' uninstalled. 实际上,我可以在卸载“ FriendlyUrls”的情况下成功构建项目。 But, of course, proper functionality is missing then. 但是,当然,那时缺少适当的功能。 Maybe somebody may have more ideas what can be done in this situation to fix the project? 也许有人可能有更多的想法,在这种情况下可以做什么来修复项目?

I had a very similar problem some time ago, the project wont compile and packages aren't really restored. 前段时间我遇到了一个非常类似的问题,该项目无法编译,并且程序包并未真正还原。

That's because the nuget management system changed on VS2015 from MS-build restore to Automatic Package restore. 这是因为nuget管理系统在VS2015上已从MS-build还原更改为Automatic Package还原。

You can use the package console to install it, but is better to follow these instructions provided by nuget: Migrating to automatic restore . 您可以使用软件包控制台进行安装,但是最好遵循nuget提供的这些说明: 迁移到自动还原

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 类型或名称空间名称“ Membership”在名称空间“ Microsoft.AspNet”中不存在 - The type or namespace name 'Membership' does not exist in the namespace 'Microsoft.AspNet' 命名空间“Microsoft.VisualBasic”中不存在类型或命名空间名称“FileIO” - The type or namespace name 'FileIO' does not exist in the namespace 'Microsoft.VisualBasic' 类型或名称空间名称“ DirectX”在名称空间“ Microsoft” Windows 8.1中不存在 - The type or namespace name 'DirectX' does not exist in the namespace 'Microsoft' Windows 8.1 命名空间“Microsoft”中不存在类型或命名空间名称“设备” - The type or namespace name 'Devices' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“Bot”? - The type or namespace name 'Bot' does not exist in the namespace 'Microsoft'? 命名空间“Microsoft”中不存在类型或命名空间名称“Reporting” - The type or namespace name 'Reporting' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“TeamFoundation” - The type or namespace name 'TeamFoundation' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“Azure” - The type or namespace name 'Azure' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“ServiceBus”? - The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft'? 类型或名称空间名称“ Lync”在名称空间“ Microsoft”中不存在 - The type or namespace name 'Lync' does not exist in the namespace 'Microsoft'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM