Boris Zinchenko Boris Zinchenko - 1 month ago 12
C# Question

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. Recently, I ve installed VisualStudio 2015 and decided to upgrade. After upgrade, I ve run standard NuGet package restore, which went just fine.

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'



  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.

  3. I ve explicitly uninstalled the package with NuGet and installed it again: No change. Error is still the same.



In fact, I can build project successfully with 'FriendlyUrls' uninstalled. 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?

Answer

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.

You can use the package console to install it, but is better to follow these instructions provided by nuget: Migrating to automatic restore.

Comments