5
votes

I'm having a strange issue with Azure!

I just recently upgraded my azure deployed site from MVC3 to MVC4. I did this by creating a brand new MVC4 project which uses only Nuget packages so should be "bin deployable"? I copied only the essential sections across from my Web.config in the root and in the Views folder.

Everything works fine locally, but after deploying to Azure I find that the role is stuck in "Busy" but the website works! It also spontaneously recycles the instance (im guessing due to its busy status).

I added Intellitrace to the deployment, and it's complaining that this reference does not exist:

Unable to load the role entry point due to the following exceptions:

-- System.IO.FileLoadException: Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0'

I have no idea why it is trying to load an MVC Version 3 reference in a 4 project. I've searched the Web.configs for any references to 3.0.0.0 and the references for the project seem fine.

Please help! Are there any extra debugging steps i can take?

Thanks!

3
Does your project by chance include MVCMailer? github.com/smsohan/MvcMailer/issues/42 - scaryman
I have had a similar issue regarding the role constantly being recycled (and re-created) due to a missing DLL, in my case it was one of the Microsoft.ReportViewer assemblies. Opening a remote desktop session to the instance, I could see that the CPU was maxing out. IntelliTrace also pointed out the problem in my case. I was missing the actual DLL in the deployment. - jamiebarrow

3 Answers

5
votes

This seems to be the same question as http://social.msdn.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/9c2f6b62-185d-4a38-8bb5-eda1917604d9. As pointed out in the other thread:

Have you configured assembly redirection? If you create a new Windows Azure project with a MVC 4 web role (now supported in SDK 1.7), you will see the following redirection:

  <dependentAssembly>
     <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
     <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
   </dependentAssembly>
0
votes

I assume you have copy local set to true for the System.Web.Mvc reference so its being copied up in your deployment package?

0
votes

I have the same problem upload my project to Azure, In addition I did your recommends respectively ,

So It was necessary to create the my project a startup task and after that I generated script for this startup task . Check your hosted service and I hosted service is windows Server R2 so I changed my ServiceConfiguration.Cloud.cscfg file .The OsFamily attribute is changed “1” to “2”.

You can find the more info in this link : Windows Azure Startup Tasks , It is written in Italian but you can translate it to English.