New WebForm app - login crashes - no owin.Environment - by Jim Mead

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 792583 Comments
Status Closed Workarounds
Type Bug Repros 7
Opened 7/4/2013 8:38:15 AM
Access Restriction Public


Fresh install of VS 2013,
then fresh install of ASP.NET and Web Tools 2013 Preview Refresh.

Create new C# Web app, select Web Forms, default authentication, 
No change to app created by template.
App runs until trying log in page.
Log in page throws exception Account\OpenAuthProviders.ascx.cs line 35
No owin.Environment item was found in context.
Sign in to post a comment.
Posted by Microsoft on 8/21/2013 at 6:21 PM
Thank you for your feedback. The issue is fixed in the next release of Visual Studio 2013.

-Web development tools team
Posted by Tratcher on 8/15/2013 at 11:48 AM
Woops, that should be <add key="owin:AppStartup" value="[Namespace].Startup, [AssemblyName]" />
Posted by Tratcher on 8/15/2013 at 11:47 AM
Most likely it cannot find the OWIN Startup class. The default convention for the Startup class is [AssemblyName].Startup. If you're no longer following that convention you'll need to specify the full name of your Startup class in the Web.Config.
    <add key="owin:AppStartup" value="[AssemblyName].Startup, [AssemblyName]" />

The upcoming RC1 Microsoft.Owin.Host.SystemWeb package now throws detailed exception messages when the Startup class cannot be found.
Posted by graycrow on 8/14/2013 at 1:01 AM
It's even worse - to reproduce the bug you just need to change original namespace. New namespace doesn't matter, should just be different.
Posted by graycrow on 7/29/2013 at 7:33 AM
I can reproduce this bug with MVC5 project by changing namespace to one which contains dots. For example WebApplication1 works, Company.ABC.WebApplication1 doesn't.
Posted by Wraith-Lunati on 7/25/2013 at 12:25 PM
I found the culprit, it seems that if you create the project with spaces in the name, the Owin context gets confused. ex, "My Web Application" vs "MyWebApplication. First one will fail, second one works.
Posted by Wraith-Lunati on 7/6/2013 at 9:54 AM
I can produce this error using Web Forms in VB as well, throws the same exception.
Posted by Microsoft on 7/4/2013 at 8:50 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(