Background
I was developing an MVC web application and I wanted to call the Microsoft Graph API. So, I started from scratch, i.e., created a new MVC application, and used the NuGet Package Manager to install the following required packages.
- Install-Package Microsoft.Owin.Host.SystemWeb
- Install-Package Microsoft.Owin.Security.OpenIdConnect
- Install-Package Microsoft.Owin.Security.OpenIdConnect
- Install-Package Microsoft.Owin.Security.Cookies
- Install-Package Microsoft.Identity.Client -Version 4.3.1
- Install-Package Microsoft.Graph -Version 1.17.0
Those packages are installed successfully. Then, I executed/ran the application, and got the following error.
![Error – No assembly found containing an OwinStartupAttribute No assembly found containing a Startup or [AssemblyName].Startup class](https://cdn.c-sharpcorner.com/article/temp/74219/fig1_mvcapp.webp)
Server Error in ‘/’ Application.
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.
Description
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details
Exception Details
System.EntryPointNotFoundException: 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.
Source Error
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace: [EntryPointNotFoundException: The following errors occurred while attempting to load the app.
Stack Trace: [EntryPointNotFoundException: 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.]
Microsoft.Owin.Host.SystemWeb.OwinBuilder.GetAppStartup() +357
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +28
System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +115
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +106
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +536
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
[HttpException (0x80004005): 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.



Ahmed Abd el'HamidPosted Apr 21, 2022, 12:04 PM
Thank you for this great answer
Rafaiya 3117Posted Feb 2, 2021, 2:39 PM
Hello i am getting error like No owin.Environment item was found in the context. and Source Error is Line 45: getLine 46: { Line 47: return _userManager ?? HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>(); Line 48: } Line 49: private set Can you suggest me some solution please?
Lasindu WeerasinghePosted Oct 10, 2020, 7:40 AM
Thank you so much. I never could find such a simple explanation. I was always worrying about "what the hell is OWIN and why is it everywhere?????"