The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' Error? The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' Error? asp.net asp.net

The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' Error?


Go to Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution.

Click on the Online Tab.

Search for Microsoft ASP.NET Identity Framework.

Install this package.

Rebuild Solution.


I guess I'm missing a reference but how come it works on the server? References for these projects can be found in the bin directory right?

Not if the used libraries are installed on the server. You might want to install them on your workstation too, or add the proper references (for example via NuGet) and do a bin-deploy.

On how to find out which libraries you're missing: find class names, not namespace names.


I had this error message too so I reinstalled all of my nuget packages again via the package manager console. Unfortunately this did not sort my issue and after loading up a completely separate project within a different solution to the one in which I was experencing: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' error, I noticed that it was occurring there too. This meant that there was an issue with my Visual Studio rather than a problem with individual packages or projects.

It turns out that my MEF Component Cache was corrupted - to fix this I deleted my Visual Studio's component model cache folder which can be found here:

%LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache

Mads Kristensen has created a Clear MEF Component Cache Visual Studio extention which you may find useful:

Clear MEF Component Cache