Visual Studio hangs at "Starting the roles for the application in the Windows Azure compute emulator". Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING)

Answered Visual Studio hangs at "Starting the roles for the application in the Windows Azure compute emulator". Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING)

  • 2012年8月2日 21:13
     
      包含代码

    Hi,

    Got a very weird problem. My project was building and running just fine up until today when, for no apparent reason, I started getting this error.

    If I Ctrl+F5 to run the app, the emulator icon appears but the Azure deployment dialog hangs at the "Starting the roles..." phase.

    It stays like that for about 60 seconds and then I get something along the lines "It's taking too long, continue waiting."

    If I reply Yes and leave the computer for 1 hour, it's still stuck there.

    So, I cancel and try F5 to debug the app. This time, the same thing happens but I also get a VS exception dialog with this exception:

    FaultException'1 was unhandledSystem.ServiceModel.FaultException`1 was unhandled  Message=Invalid class string (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING))  Source=mscorlib  Action=http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher/fault  StackTrace:    Server stack trace:        at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)       at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)    Exception rethrown at [0]:        at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)       at IConfigurator.Deploy(String roleId, WebAppModel webAppModel, String roleRootDirectory, String sitesDestinationRootDirectory, String diagnosticsRootDirectory, String roleGuid, String configPath)       at Microsoft.WindowsAzure.Hosts.WaIISHost.Program.Main(String[] args)  InnerException: 

    Invalid Class String? huh?

    I've rebooted, etc. etc. but can't figure it out.

    HELP!!! I'm on a deadline!!! 

    VS 2010 Ultimate, Win 7 Pro, Azure SDK 1.7, C#, .NET 4.0.


    Simon Goldstone www.ActiveDataTools.com Data Cleansing, Correction and Management Software


    • 已编辑 sigol 2012年8月5日 18:18 Added error message to title
    •  

全部回复

  • 2012年8月2日 21:36
     
     

    RESOLVED! (Sort Of)

    I don't know what the problem is but I know how to fix it...

    Make a note of all your configuration settings, etc. and then delete the web role.

    Add a new web role and link it back to your existing web app.

    Replace the settings.

    All working!

    Hope this helps someone else.


    Simon Goldstone www.ActiveDataTools.com Data Cleansing, Correction and Management Software

    • 已标记为答案 sigol 2012年8月2日 21:36
    • 取消答案标记 sigol 2012年8月5日 18:13
    •  
  • 2012年8月5日 18:15
     
      包含代码

    NO - NOT RESOLVED AFTER ALL. 

    The problem is to do with HTTPS Endpoints. 

    If I have a lone HTTP end point in my Role configuration, all works perfectly. I can F5 or Ctrl+F5, debug or run without any issue.

    However, the moment I put an https endpoint in, it stops working. 

    In Run mode, it hangs at "starting the roles..." phase. In debug mode, I get the 

    Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING)

    error described above. I cannot find a way to fix this. Please can somebody assist?


    Simon Goldstone www.ActiveDataTools.com Data Cleansing, Correction and Management Software

  • 2012年8月5日 21:59
     
     

    Hi

    I got the exact same problem, and I've found that when removing/adding the web role, it works until I commit the code and download it onto a new development client. (and yes, it seems to be connected to the HTTPS endpoint, all is good when using just HTTP)

    If anyone has any insights to share, it would be much appreciated.

    /Martin

  • 2012年8月6日 1:55
     
     

    Hi Martin,

    Excellent - Yes, you're right. That's exactly what happened, come to think of it. Everything was working fine until I checked the source out on to another workstation. When the source is checked back in, it screws up both workstations.

    MSFT or MSVPs help!


    Simon Goldstone www.ActiveDataTools.com Data Cleansing, Correction and Management Software

  • 2012年8月17日 6:28
     
     

    Just got this exact same issue on my new dev machine:

    Windows 8 Enterprise RTM

    Visual Studio 2012 Ultimate RTM

    Azure SDK June 2012 SP1

    I've ensured I imported the SSL cert for the HTTPS endpoint.  IISExpress is selected.  I've tried removing and readding SSLEndpoint in Role Config... still same issue. 

  • 2012年8月17日 13:10
     
     

    This may or may not be relevant to your problem, but I ended up on this thread as a result of very similar symptoms to yours, and here's how I was able to fix the problem.

    In the Windows Event Viewer, I looked in the Windows Azure section under Applications and Services Logs and discovered that one of the startup tasks was failing (due to a modification someone else had made). I used the technique shown at http://blog.smarx.com/posts/skipping-windows-azure-startup-tasks-when-running-in-the-emulator to skip that task locally and it fixed the problem.

  • 2012年8月17日 13:27
     
     

    I can confirm that the problem also exists on the brand new VS 2012 Ultimate. If I have an http and an https endpoint my dev machine hangs.

    I will try IanG's suggestion and report back...


    Simon Goldstone www.ActiveDataTools.com Data Cleansing, Correction and Management Software

  • 2012年8月17日 13:28
     
     
    Thanks IanG, will check that out...

    Simon Goldstone www.ActiveDataTools.com Data Cleansing, Correction and Management Software

  • 2012年8月17日 13:34
     
      包含代码

    Hi Ian, thanks for your post.

    I checked the Windows Event Log and found this:

    An unhandled exception occurred. Type: System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail] Process ID: 12388
    Process Name: WaIISHost
    Thread ID: 1
    AppDomain Unhandled Exception for role deployment17(104).WindowsAzureMain.PROJECTNAMEHERE.PresentationLayer.BackWeb_IN_0
    Exception: Invalid class string (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING))
    
    Server stack trace: 
       at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
       at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at IConfigurator.Deploy(String roleId, WebAppModel webAppModel, String roleRootDirectory, String sitesDestinationRootDirectory, String diagnosticsRootDirectory, String roleGuid, String configPath)
       at Microsoft.WindowsAzure.Hosts.WaIISHost.Program.Main(String[] args)
    

    Unfortunately, the article you point to at smarx is not relevant in my case as I have no startup tasks.


    Simon Goldstone www.ActiveDataTools.com Data Cleansing, Correction and Management Software

  • 2012年8月17日 13:39
     
     

    I've now been able to reproduce the issue on a vanilla VM. If you create a Windows Azure project with two end points, one http and one https everything works fine. If you then check in to TFS it still works fine.

    If you then check out on to another machine (VM2) then suddenly it stops working, even if you re-install the certificate, etc. on this new VM.

    If you then go back to the original VM, and check out the project, it no longer works.

    It seems that as soon as you introduce a second machine in to the development of the project (under TFS) it stops.

    From then on, the only way to get the project to run/debug on your dev machine is to remove the https endpoint.

    However, if you compile and publish the app to Azure with both endpoints, they work perfectly.

    So the current development cycle for me is, remove https endpoint and develop as needed, debug, etc.

    When it's time to build and publish, add the https endpoint in to the project, publish and then remove it to continue developing.

    Pain in the ass!

    (PS - still a problem in VS 2012 Ultimate)



    • 已编辑 sigol 2012年8月17日 13:39 adding VS version
    •  
  • 2012年8月17日 16:21
     
     

    Yes I can validate that all the following have to be true to get the error (I'm using github not TFS):

    • checkout azure project to new machine (mine is Win8 RTM with VS2012 and Azure SDK June 2012 SP1)
    • have a SSL endpoint in the web role, doesn't seem to matter if it's in addition to HTTP or if by itself
    • On starting debug, you receive: Invalid class string (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING))
    • Then compute emulator will shutdown

    Note that even if you close VS2012 afterward, MSBuild will still have multiple processes running in task mgr... which I've tried closing and testing again. Also, I've updated NuGet packages for recent updates to Azure Configuration Manager.

    Workaround: Remove SSL endpoint from web roles while debugging.  Haven't tried adding SSL endpoint back and pushing to Azure, but I imagine this is just a local SDK issue and not related to proper functioning on Azure.

  • 2012年8月17日 17:03
     
     
    Time to raise it on Microsoft Connect then...

    Simon Goldstone www.ActiveDataTools.com Data Cleansing, Correction and Management Software

  • 2012年8月17日 17:11
     
     

    I've raised this issue here:

    https://connect.microsoft.com/VisualStudio/feedback/details/758533

    Please can you vote it up so that MSFT look at it faster...

    Thanks


    Simon Goldstone www.ActiveDataTools.com Data Cleansing, Correction and Management Software

  • 2012年8月20日 7:55
     
     已答复

    I too encountered this issue. The symptoms looked the same - Azure emulator worked fine running with an HTTP endpoint, but failed as soon as an HTTPS endpoint was added, all using IIS express.

    The solution I found that worked was installing IIS 7. It doesn't need to be running - you can just set the service startup mode to manual and never actually use it. Unfortunately I haven't had a chance to go through and work out exactly which component of IIS fixes it - I just installed the default components through Control Panel --> Turn Windows Features On or Off.

    Once it's installed, everything works fine. I've used this solution twice, once on VS2010/Win7 and once (just now) on VS2012 Premium / Win8 RTM.

    Hope this helps.

    • 已建议为答案 Benjimawoo 2012年8月20日 7:55
    • 已标记为答案 sigol 2012年8月20日 19:54
    •  
  • 2012年8月20日 15:16
     
     

    This worked for me as well after I figured out full IIS was the one thing different between my Win7/VS2012RC install and my Win8/VS2012 one.  Also at some point I started getting an error in addition to the ones described above that led me to needing full IIS.  Note in my Azure project and Web projects I've still got IISExpress selected.  I installed the same IIS features that were on my old dev box, so not sure which one actually fixed the issue.

  • 2012年8月20日 19:55
     
     

    *******************

    * YES YES YES YES YES *

    *******************

    Benjamiawoo - you are a hero.

    That fixed the problem.

    +1 from me. Thanks.


    Simon Goldstone www.ActiveDataTools.com Data Cleansing, Correction and Management Software


    • 已编辑 sigol 2012年8月23日 12:00
    •  
  • 2012年9月18日 6:49
     
     

    Hi

    I can also confirm that installing IIS with default components solved this issue.

    Thanks a lot to those who took the time to figure this out!

    /Martin


  • 2012年9月19日 19:49
     
     

    Hi

    +1 for me too.

    Benjamiawoo you are the best.

    Sébastien

  • 2012年11月23日 7:16
     
     

    WORKED FOR ME AS WELL...!!

    You are hero.