title: Azure Web Role not starting after upgrade to .Net 4.5 & osFamily 3 (Window 2012)
body: <p>I have MVC 3 Application that used to work fine on osFamily 1 (Win 2008 SP2) and .Net 4.0 and would like to upgrade to .Net 4.5 and Windows 2012.</p>
  
  <p>My project is upgraded to .Net 4.5 and it builds without any problems and runs in emulator with no problems.</p>
  
  <p>When I deploy to Windows Azure the role i get this message - </p>
  
  <p>"Recycling (Waiting for role to start... Sites were deployed. [2013-06-01T10:43:59Z])"</p>
  
  <p>I remotely logged in to the machine and I found the below error messages in the windows event viewer.</p>
  
  <h3>Error Message 1</h3>
  
  <pre><code>Log Name:      Application
  Source:        Application Error
  Date:          6/1/2013 10:15:39 AM
  Event ID:      1000
  Task Category: (100)
  Level:         Error
  Keywords:      Classic
  User:          N/A
  Computer:      RD00155D492637
  Description:
  Faulting application name: WaHostBootstrapper.exe, version: 6.0.6002.18488, time stamp: 0x50a71329
  Faulting module name: ntdll.dll, version: 6.2.9200.16420, time stamp: 0x505ab405
  Exception code: 0xc0000005
  Fault offset: 0x0000000000005d92
  Faulting process id: 0xadc
  Faulting application start time: 0x01ce5eb0eff6e9f1
  Faulting application path: E:\base\x64\WaHostBootstrapper.exe
  Faulting module path: D:\Windows\SYSTEM32\ntdll.dll
  Report Id: 34c3ae25-caa4-11e2-93ef-00155d492637
  Faulting package full name: 
  Faulting package-relative application ID: 
  Event Xml:
  &lt;Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"&gt;
    &lt;System&gt;
      &lt;Provider Name="Application Error" /&gt;
      &lt;EventID Qualifiers="0"&gt;1000&lt;/EventID&gt;
      &lt;Level&gt;2&lt;/Level&gt;
      &lt;Task&gt;100&lt;/Task&gt;
      &lt;Keywords&gt;0x80000000000000&lt;/Keywords&gt;
      &lt;TimeCreated SystemTime="2013-06-01T10:15:39.000000000Z" /&gt;
      &lt;EventRecordID&gt;8187&lt;/EventRecordID&gt;
      &lt;Channel&gt;Application&lt;/Channel&gt;
      &lt;Computer&gt;RD00155D492637&lt;/Computer&gt;
      &lt;Security /&gt;
    &lt;/System&gt;
    &lt;EventData&gt;
      &lt;Data&gt;WaHostBootstrapper.exe&lt;/Data&gt;
      &lt;Data&gt;6.0.6002.18488&lt;/Data&gt;
      &lt;Data&gt;50a71329&lt;/Data&gt;
      &lt;Data&gt;ntdll.dll&lt;/Data&gt;
      &lt;Data&gt;6.2.9200.16420&lt;/Data&gt;
      &lt;Data&gt;505ab405&lt;/Data&gt;
      &lt;Data&gt;c0000005&lt;/Data&gt;
      &lt;Data&gt;0000000000005d92&lt;/Data&gt;
      &lt;Data&gt;adc&lt;/Data&gt;
      &lt;Data&gt;01ce5eb0eff6e9f1&lt;/Data&gt;
      &lt;Data&gt;E:\base\x64\WaHostBootstrapper.exe&lt;/Data&gt;
      &lt;Data&gt;D:\Windows\SYSTEM32\ntdll.dll&lt;/Data&gt;
      &lt;Data&gt;34c3ae25-caa4-11e2-93ef-00155d492637&lt;/Data&gt;
      &lt;Data&gt;
      &lt;/Data&gt;
      &lt;Data&gt;
      &lt;/Data&gt;
    &lt;/EventData&gt;
  &lt;/Event&gt; 
  </code></pre>
  
  <h3>Error Message 2</h3>
  
  <pre><code>Log Name:      Application
  Source:        .NET Runtime
  Date:          6/1/2013 10:15:39 AM
  Event ID:      1026
  Task Category: None
  Level:         Error
  Keywords:      Classic
  User:          N/A
  Computer:      RD00155D492637
  Description:
  Application: CacheDumpGenerator.exe
  Framework Version: v4.0.30319
  Description: The process was terminated due to an unhandled exception.
  Exception Info: System.Runtime.InteropServices.SEHException
  Stack:
     at &lt;Module&gt;.RdGetLocalResource(UInt16*, _RD_RESOURCE**)
     at &lt;Module&gt;.RdGetLocalResource(UInt16*, _RD_RESOURCE**)
     at &lt;Module&gt;._LOCALRESOURCE.GetLocalResourceW(UInt16*, _LOCALRESOURCE**)
     at Microsoft.WindowsAzure.ServiceRuntime.Internal.InteropRoleManager.GetLocalResource(System.String, Microsoft.WindowsAzure.ServiceRuntime.Internal.InteropLocalResource ByRef)
     at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetLocalResource(System.String)
     at Microsoft.ApplicationServer.Caching.AzureCommon.AzureUtility.GetLocalStoreDirectory()
     at Microsoft.ApplicationServer.Caching.AzureCommon.AzureStartupLogger.InitializeTraceProvider()
     at Microsoft.ApplicationServer.Caching.AzureCommon.AzureStartupLogger.get_TraceProvider()
     at Microsoft.ApplicationServer.Caching.AzureCommon.AzureStartupLogger.WriteLog(System.String, System.Diagnostics.TraceEventType, System.String)
     at Microsoft.ApplicationServer.Caching.CacheDumpGenerator.ProcessDump.Main(System.String[])
  
  Event Xml:
  &lt;Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"&gt;
    &lt;System&gt;
      &lt;Provider Name=".NET Runtime" /&gt;
      &lt;EventID Qualifiers="0"&gt;1026&lt;/EventID&gt;
      &lt;Level&gt;2&lt;/Level&gt;
      &lt;Task&gt;0&lt;/Task&gt;
      &lt;Keywords&gt;0x80000000000000&lt;/Keywords&gt;
      &lt;TimeCreated SystemTime="2013-06-01T10:15:39.000000000Z" /&gt;
      &lt;EventRecordID&gt;8188&lt;/EventRecordID&gt;
      &lt;Channel&gt;Application&lt;/Channel&gt;
      &lt;Computer&gt;RD00155D492637&lt;/Computer&gt;
      &lt;Security /&gt;
    &lt;/System&gt;
    &lt;EventData&gt;
      &lt;Data&gt;Application: CacheDumpGenerator.exe
  Framework Version: v4.0.30319
  Description: The process was terminated due to an unhandled exception.
  Exception Info: System.Runtime.InteropServices.SEHException
  Stack:
     at &amp;lt;Module&amp;gt;.RdGetLocalResource(UInt16*, _RD_RESOURCE**)
     at &amp;lt;Module&amp;gt;.RdGetLocalResource(UInt16*, _RD_RESOURCE**)
     at &amp;lt;Module&amp;gt;._LOCALRESOURCE.GetLocalResourceW(UInt16*, _LOCALRESOURCE**)
     at Microsoft.WindowsAzure.ServiceRuntime.Internal.InteropRoleManager.GetLocalResource(System.String, Microsoft.WindowsAzure.ServiceRuntime.Internal.InteropLocalResource ByRef)
     at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetLocalResource(System.String)
     at Microsoft.ApplicationServer.Caching.AzureCommon.AzureUtility.GetLocalStoreDirectory()
     at Microsoft.ApplicationServer.Caching.AzureCommon.AzureStartupLogger.InitializeTraceProvider()
     at Microsoft.ApplicationServer.Caching.AzureCommon.AzureStartupLogger.get_TraceProvider()
     at Microsoft.ApplicationServer.Caching.AzureCommon.AzureStartupLogger.WriteLog(System.String, System.Diagnostics.TraceEventType, System.String)
     at Microsoft.ApplicationServer.Caching.CacheDumpGenerator.ProcessDump.Main(System.String[])
  &lt;/Data&gt;
    &lt;/EventData&gt;
  &lt;/Event&gt;
  </code></pre>
  
  <h3>Error Message 3</h3>
  
  <pre><code>Log Name:      Application
  Source:        Application Error
  Date:          6/1/2013 10:15:39 AM
  Event ID:      1000
  Task Category: (100)
  Level:         Error
  Keywords:      Classic
  User:          N/A
  Computer:      RD00155D492637
  Description:
  Faulting application name: CacheDumpGenerator.exe, version: 1.0.4797.0, time stamp: 0x506f41e8
  Faulting module name: KERNELBASE.dll, version: 6.2.9200.16451, time stamp: 0x50988aa6
  Exception code: 0xc06d007e
  Fault offset: 0x000000000003811c
  Faulting process id: 0x1934
  Faulting application start time: 0x01ce5eb0f71984a5
  Faulting application path: E:\plugins\Caching\CacheDumpGenerator.exe
  Faulting module path: D:\Windows\system32\KERNELBASE.dll
  Report Id: 34e2aca6-caa4-11e2-93ef-00155d492637
  Faulting package full name: 
  Faulting package-relative application ID: 
  Event Xml:
  &lt;Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"&gt;
    &lt;System&gt;
      &lt;Provider Name="Application Error" /&gt;
      &lt;EventID Qualifiers="0"&gt;1000&lt;/EventID&gt;
      &lt;Level&gt;2&lt;/Level&gt;
      &lt;Task&gt;100&lt;/Task&gt;
      &lt;Keywords&gt;0x80000000000000&lt;/Keywords&gt;
      &lt;TimeCreated SystemTime="2013-06-01T10:15:39.000000000Z" /&gt;
      &lt;EventRecordID&gt;8189&lt;/EventRecordID&gt;
      &lt;Channel&gt;Application&lt;/Channel&gt;
      &lt;Computer&gt;RD00155D492637&lt;/Computer&gt;
      &lt;Security /&gt;
    &lt;/System&gt;
    &lt;EventData&gt;
      &lt;Data&gt;CacheDumpGenerator.exe&lt;/Data&gt;
      &lt;Data&gt;1.0.4797.0&lt;/Data&gt;
      &lt;Data&gt;506f41e8&lt;/Data&gt;
      &lt;Data&gt;KERNELBASE.dll&lt;/Data&gt;
      &lt;Data&gt;6.2.9200.16451&lt;/Data&gt;
      &lt;Data&gt;50988aa6&lt;/Data&gt;
      &lt;Data&gt;c06d007e&lt;/Data&gt;
      &lt;Data&gt;000000000003811c&lt;/Data&gt;
      &lt;Data&gt;1934&lt;/Data&gt;
      &lt;Data&gt;01ce5eb0f71984a5&lt;/Data&gt;
      &lt;Data&gt;E:\plugins\Caching\CacheDumpGenerator.exe&lt;/Data&gt;
      &lt;Data&gt;D:\Windows\system32\KERNELBASE.dll&lt;/Data&gt;
      &lt;Data&gt;34e2aca6-caa4-11e2-93ef-00155d492637&lt;/Data&gt;
      &lt;Data&gt;
      &lt;/Data&gt;
      &lt;Data&gt;
      &lt;/Data&gt;
    &lt;/EventData&gt;
  &lt;/Event&gt;
  </code></pre>
  
  <p>ServiceConfiguration.Cloud.csfg</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ServiceConfiguration serviceName="OpenSpaceAzureDeploymentTesting" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="3" osVersion="*" schemaVersion="2012-10.1.8"&gt;
    &lt;Role name="OpenSpaceGUI"&gt;
      &lt;Instances count="1" /&gt;
      &lt;ConfigurationSettings&gt;
        &lt;Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="***" /&gt;
        &lt;Setting name="DataConnectionString" value="***" /&gt;
        &lt;Setting name="InMaintenanceMode" value="false" /&gt;
        &lt;Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" /&gt;
        &lt;Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="***" /&gt;
        &lt;Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="RxM6fiusFUxD/10qlvm0xvwMMBy0qbcGpsMRQUUufHD3DlUnJcaASHP0ygRESmvQDPh2ig0FsA0WK65UDrIJxFnBmRTH4WMPmJIlBa5w2Uht/g7wScwZ3UWN6NEQiHpdCPJSayef2iO3VVXRXxZYiHNdP25sMglcEmPQkVVyE4icoVHhFPffjR24uH7uNf8GK83jIbYYAcPKlVOE84pt5a/EPXG1vBQivf9nxRW84Z2jMxmectqi7Ip0tMjWnZx/IE9J28DwhKmnQSn3wlE4/qqGNxVOSp33VvAMDsGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIwFSSGHiZSSeAGH3U73yNANRQw6W4sIlmu1lpNEXv2mdWzQ==" /&gt;
        &lt;Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="2050-01-01T23:59:59.0000000+00:00" /&gt;
        &lt;Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" /&gt;
        &lt;Setting name="Microsoft.WindowsAzure.Plugins.Caching.NamedCaches" value="{&amp;quot;caches&amp;quot;:[{&amp;quot;name&amp;quot;:&amp;quot;default&amp;quot;,&amp;quot;policy&amp;quot;:{&amp;quot;eviction&amp;quot;:{&amp;quot;type&amp;quot;:0},&amp;quot;expiration&amp;quot;:{&amp;quot;defaultTTL&amp;quot;:10,&amp;quot;isExpirable&amp;quot;:true,&amp;quot;type&amp;quot;:2},&amp;quot;serverNotification&amp;quot;:{&amp;quot;isEnabled&amp;quot;:false}},&amp;quot;secondaries&amp;quot;:0},{&amp;quot;name&amp;quot;:&amp;quot;companies&amp;quot;,&amp;quot;policy&amp;quot;:{&amp;quot;eviction&amp;quot;:{&amp;quot;type&amp;quot;:0},&amp;quot;expiration&amp;quot;:{&amp;quot;defaultTTL&amp;quot;:10,&amp;quot;isExpirable&amp;quot;:true,&amp;quot;type&amp;quot;:2},&amp;quot;serverNotification&amp;quot;:{&amp;quot;isEnabled&amp;quot;:false}},&amp;quot;secondaries&amp;quot;:0},{&amp;quot;name&amp;quot;:&amp;quot;person&amp;quot;,&amp;quot;policy&amp;quot;:{&amp;quot;eviction&amp;quot;:{&amp;quot;type&amp;quot;:0},&amp;quot;expiration&amp;quot;:{&amp;quot;defaultTTL&amp;quot;:10,&amp;quot;isExpirable&amp;quot;:true,&amp;quot;type&amp;quot;:2},&amp;quot;serverNotification&amp;quot;:{&amp;quot;isEnabled&amp;quot;:false}},&amp;quot;secondaries&amp;quot;:0}]}" /&gt;
        &lt;Setting name="Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel" value="1" /&gt;
        &lt;Setting name="Microsoft.WindowsAzure.Plugins.Caching.CacheSizePercentage" value="30" /&gt;
        &lt;Setting name="Microsoft.WindowsAzure.Plugins.Caching.ConfigStoreConnectionString" value="****" /&gt;
        &lt;Setting name="SiteStatus" value="ok" /&gt;
      &lt;/ConfigurationSettings&gt;
      &lt;Certificates&gt;
        &lt;Certificate name="*.co.uk" thumbprint="**" thumbprintAlgorithm="sha1" /&gt;
        &lt;Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="BA399EA1E35B7E3FB00569C0FE1BCA76939EE87F" thumbprintAlgorithm="sha1" /&gt;
      &lt;/Certificates&gt;
    &lt;/Role&gt;
  &lt;/ServiceConfiguration&gt;
  </code></pre>
  
  <p>Any help will be appreciated !!</p>
  
  <p>Thanks
  Bhavesh</p>
  
  <hr>
  
  <p>I did try to remove the Windows.Azure.Caching from my project by removing the package from NuGet, them I tried to deploy to cloud and the web role was deployed successfully but I was unable to browse to my application as it was complaining about  in the web.config. </p>
  
  <p>I found the below code was still there in web.config and not cleaned by nuGet.</p>
  
  <pre><code>&lt;dataCacheClients&gt;
      &lt;dataCacheClient&gt;
        &lt;autoDiscover isEnabled="true" identifier="OpenSpaceGUI" /&gt;
  
      &lt;/dataCacheClient&gt;
  &lt;/dataCacheClients&gt;
  </code></pre>
  
  <p>I removed the above code from web.config and deployed to cloud once again but no luck the web role is recycling in a end-less loop and i found this error details once I remote logged in to the server.</p>
  
  <pre><code>Log Name:      Microsoft-Azure-IISConfigurator/Operational
  Source:        Microsoft-Azure-IISConfigurator
  Date:          6/5/2013 9:25:38 PM
  Event ID:      3303
  Task Category: None
  Level:         Error
  Keywords:      
  User:          SYSTEM
  Computer:      RD00155D49FC3E
  Description:
  Exception:System.Runtime.InteropServices.COMException (0xC00CEF03): Exception from HRESULT: 0xC00CEF03
  
  Server stack trace: 
     at Microsoft.Web.Administration.Interop.AppHostWritableAdminManager.CommitChanges()
     at Microsoft.Web.Administration.Configuration.CommitChanges()
     at Microsoft.Web.Administration.ConfigurationManager.CommitChanges()
     at Microsoft.Web.Administration.ServerManager.CommitChanges()
     at Microsoft.WindowsAzure.ServiceRuntime.IISConfigurator.WasManager.DeploySite(String roleId, WASite roleSite, String appPoolName, String sitePath, String iisLogsRootFolder, String failedRequestLogsRootFolder, List`1 bindings, List`1 protocols, FileManager fileManager, WAAppPool defaultAppPoolSettings, String roleGuid, String&amp; appPoolSid, List`1 appPoolsAdded, String configPath)
     at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]&amp; outArgs)
     at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
  
  Exception rethrown at [0]: 
     at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
     at Microsoft.WindowsAzure.ServiceRuntime.IISConfigurator.WasContainer.DeploySite(String roleId, WASite roleSite, String appPoolName, String sitePath, String iisLogsRootFolder, String failedRequestLogsRootFolder, List`1 bindings, List`1 protocols, FileManager fileManager, WAAppPool defaultAppPoolSettings, String roleGuid, String&amp; appPoolSid, List`1 appPoolsAdded, String configPath)
     at Microsoft.WindowsAzure.ServiceRuntime.IISConfigurator.IISConfigurator.Deploy(String roleId, WebAppModel webAppModel, String roleRootDirectory, String sitesDestinationRootDirectory, String diagnosticsRootDirectory, String roleGuid, String configPath)
  </code></pre>
  
  <p>I have no clue now why this is not working, any help will be appreciated.</p>
  
  <p>Thanks</p>