No assembly found containing an OwinStartupAttribute. error in asp.net mvc project


Hi, I have just created a project using Visual Studio 2015 & selected MVC template, but When I tried to build the project and executed it in the browser, I got the error as below

The following errors occurred while attempting to load the app.
- No assembly found containing an OwinStartupAttribute.
- No assembly found containing a Startup or [AssemblyName].Startup class.
To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config.
To specify the OWIN startup Assembly, Class, or Method, add the appSetting owin:AppStartup with the fully qualified startup class or configuration method name in your web.config.

Here is the Image of the error

owin-start-up-class-in-missing-asp-net-mvc-min.png

How can I resolve this error?What did I miss?

Thanks


Asked by:- Vinnu
0
: 278 At:- 3/12/2018 12:45:37 PM
C# asp.net mvc owin






1 Answers
profileImage Answered by:- neena

1. Check if there is Startup.cs file in the root folder of your project, if not please create startup.cs in the root of propject like below example

public class Startup
{
    //For more information on how to configure your application,
    //visit http://go.microsoft.com/fwlink/?LinkID=398940
    public void ConfigureServices(IServiceCollection services)
    {
                services.AddMvc();
    }

    public void Configure(IApplicationBuilder app)
    {
             app.UseMvc();
    }
}

2. OR add the key owin:AutomaticAppStartup set to false in your appSettings

<appSettings>

   <addkey="owin:AutomaticAppStartup" value=“false“ />

</appSettings>

One of the above solutions should solve your issue

2
At:- 3/13/2018 2:15:49 PM Updated at:- 3/13/2018 2:16:30 PM
First solution worked for, I checked my solution explorer, I was missing Startup.cs file, so created it as explained by you and it worked, so I didn't try 2nd solution, thanks 0
By : Vinnu - at :- 3/16/2018 12:14:39 PM





Login/Register to answer
Or
Register directly by posting answer/details

Full Name *

Email *




By posting your answer you agree on privacy policy & terms of use