I'm getting an error when I'm attempting to run my page says that,
The name 'ConfigureAuth' does not exist in the current context
in my Stratup
Class. I'm sure all AspNet Identity
libraries are installed. What do I need to do next, to try to fix this?
using Microsoft.Owin;
using Owin;
[assembly: OwinStartupAttribute(typeof(project_name.Startup))]
namespace project_name
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
}
}
}
Kindly I note that the two partial classes (Startup.Auth.cs and Startup.cs) should be in the same namespace which is the root of the project, just change the namespace of Startup.Auth.cs to the same namespace of the Startup.cs
If you are using default Visual Studio project template, the
ConfigureAuth
method could be found in partial classStartup.Auth.cs
. So make sure you didn't break anything when modifying project structure.This is an example of
ConfigureAuth
method:It is either:
OR
Either rename OwinStartupAttribute to OwinStartup OR Configuration to ConfigureAuth
Make sure when you originally create the project that there are no spaces in the name. e.g. my app was called "DevOps Test" which was giving me errors when I ran it. I recreated it as "DevopsTest" and no longer had these issues
I had similar issue, To fix the issue I removed .App_Start from namespace in Startup.Auth.cs file. After that I was able to see the reference.