none
"Enable Windows Azure Authentication" gives me COMException

    Question

  • The ASP.NET fall update with its WAAD support is exactly what I need, and Vittorio's //build demo of it was promising. However, when I try it on my own solution, I fail miserably.

    Upon clicking "Enable Windows Azure authentication" on an ASP.NET MVC 4.0 / .NET 4.5 project with no authentication so far, I get a dialog that coolly states "System.Runtime.InteropServices.COMException". Is this a known issue? Is there something more I could provide to help debug this?

    TIA,

    Jouni

    Tuesday, November 6, 2012 5:17 AM

Answers

  • Turns out that at some point, our Web project configuration's virtual directory settings for IIS Express were lost -- probably when we started to run the app as an Azure Web Role. Notice that it's not even possible for us to have caused this ourselves, as the Visual Studio UI doesn't allow us to save this combination of settings.

    Why is this relevant? Well, if your web project is configured to use IIS Express but has no configured virtual directory, it's not possible to enable SSL support for the site. When you enable Azure Authentication, one of the things it tries to do is enable SSL support, which results in said COMException.

    Curiously, trying to switch the "SSL Enabled" property of the project to "True" before fixing the virtual directory also results in an error dialog... that says the "property value is not valid." Which is technically true but highly confusing: the message actually refers to the virtual directory, not the property you're trying to set.

    • Marked as answer by JouniHeikniemi Thursday, November 15, 2012 5:11 AM
    Wednesday, November 14, 2012 1:02 PM

All replies

  • Hi Jouni,

    Thanks for letting us know. Do you see this problem every time you use Enable Windows Azure Authentication feature with a new VS instance and MVC 4.0 / .NET 4.5 project? Does it help if you run VS as an Admin?

    Thanks,

    Bhavesh

    Friday, November 9, 2012 1:42 AM
  • Turns out that at some point, our Web project configuration's virtual directory settings for IIS Express were lost -- probably when we started to run the app as an Azure Web Role. Notice that it's not even possible for us to have caused this ourselves, as the Visual Studio UI doesn't allow us to save this combination of settings.

    Why is this relevant? Well, if your web project is configured to use IIS Express but has no configured virtual directory, it's not possible to enable SSL support for the site. When you enable Azure Authentication, one of the things it tries to do is enable SSL support, which results in said COMException.

    Curiously, trying to switch the "SSL Enabled" property of the project to "True" before fixing the virtual directory also results in an error dialog... that says the "property value is not valid." Which is technically true but highly confusing: the message actually refers to the virtual directory, not the property you're trying to set.

    • Marked as answer by JouniHeikniemi Thursday, November 15, 2012 5:11 AM
    Wednesday, November 14, 2012 1:02 PM
  • Lauri's windbg detective gig obviously squeezed out the right answer as seen above. That, of course, still leaves the bug for you guys to fix. :-)

    Thursday, November 15, 2012 5:12 AM