Azure installation keeps failing

Topics: Installing Orchard
Mar 29, 2011 at 8:55 PM

Hi!

I have been trying for weeks to get Orchard to work on Azure with no luck. I've been trying to install it with custom modules, but now decided to see if it works with the clean source first.

After several tries and fixes I now got to a point where at least the setup page shows up. How I finally got here is explained below:

- downloaded full orchard src from kiln https://hg01.codeplex.com/orchard (last tested with Changeset 4810 (c4c3beaaa734))
- applied the patch mentioned in this link: http://orchard.codeplex.com/discussions/249654 (otherwise I would get the error mentioned there)
- ClickToBuildAzure.cmd
- Cleaned Azure storage (delete containers 'media' and 'sites')
- Uploaded via Azure Managment portal
- Orchard Setup appears

Then at this point, I run the setup with ordinary setup info, and this SQL string:
Data Source=xyz.database.windows.net;Initial Catalog=mydbname;User ID=myuserid;Password=123456;

Setup starts running but then it fails with this error:

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 57: 	<div>
Line 58:         <select id="@Html.FieldIdFor(m => m.Recipe)" name="@Html.FieldNameFor(m => m.Recipe)" class="recipe">
Line 59:         @foreach(var recipe in Model.Recipes) {
Line 60:             @Html.SelectOption(Model.Recipe, recipe.Name, recipe.Name, new { recipedescription = recipe.Description })
Line 61:         }


Source File: e:\approot\Modules\Orchard.Setup\Views\Setup\Index.cshtml Line: 59  

 

 

Can you please help me?

I really need to get this website going, so I'd really really appreciate your prompt reply.

Thanks!

Coordinator
Mar 29, 2011 at 10:11 PM

It seems you are trying to deploy something else than the default branch. Can you confirm that ?

If this is the case, you should know that the dev and 1.x branches if you are using them are not validated to be running on Azure yet. I am working on it though, but it's not finished.

Mar 30, 2011 at 10:25 AM

Hi Sebastien,

Thank you so much for your swift response, it works now.

I've used the latest changeset from the 'default' branch and then modified the file \src\Orchard.Azure\Orchard.Azure.Web\Orchard.Azure.Web.csproj in order to add the correponding <Private>True</Private> to each of the required assemblies.

I could finish the setup and can now see my site and my dashboard.

On to the next step, ading my custom modules and themes. Hopefully all goes well now.

Thanks again!

Mar 30, 2011 at 3:03 PM

Hi Sebastien,

I got through the steps of installing the custom modules and theme, but unfortunately when I deploy it, I get to a new error:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0121: The call is ambiguous between the following methods or properties: 'Orchard.Modules.Events.Extensions.UrlHelperExtensions.EventsForAdmin(System.Web.Mvc.UrlHelper)' and 'Orchard.Modules.Events.Extensions.UrlHelperExtensions.EventsForAdmin(System.Web.Mvc.UrlHelper)'

Source Error:

 
Line 82:             _eventsSlugConstraint.AddSlug(events.As<IRoutableAspect>().GetEffectiveSlug());
Line 83: 
Line 84:             return Redirect(Url.EventsForAdmin());
Line 85:         }
Line 86: 


Source File: f:\approot\Modules\EventsCalendar\Controllers\EventsAdminController.cs Line: 84 

 

 

Basically the file in which the error occurs is one of our custom modules, however the strange thing is that it seems  to be some kind of double-compilation, since the above error is accompanied by loads of warnings like the one below:

 

Warning: CS0436: The type 'Orchard.Modules.Events.Models.EventArchivesPartRecord' in 'd:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\658c9fe4\9ba79c2e\App_Web_eventscalendar.csproj.e45d656e.l_c696j7.23.cs' conflicts with the imported type 'Orchard.Modules.Events.Models.EventArchivesPartRecord' in 'd:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\658c9fe4\9ba79c2e\assembly\dl3\7ad61152\553fbd03_ddeecb01\ExEvents.DLL'. Using the type defined in 'd:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\658c9fe4\9ba79c2e\App_Web_eventscalendar.csproj.e45d656e.l_c696j7.23.cs'.

 

Do you have any idea of something like this happening before?

By the way, after adding the modules and theme I did an Upgrade and I did not clear the DB or Storage contents.

Once again, thanks for your help!

Coordinator
Mar 30, 2011 at 6:38 PM

This is very strange, and I don't have any idea of what is happening. Can you try to make a Visual Studio Clean, delete all /bin and /obj of your module, and do a new package then publish. I just want to ensure there is no compilationg in VS prior to creating the azure package.

Mar 30, 2011 at 7:55 PM

Hi,

I tried it now, but still no luck. You can see the full error here.

http://dd662c24a8c94b038b5f185e3ba1179e.cloudapp.net/

As you are already hinting, it seems to be something with the compilation process. I will keep trying other ways to clean up (maybe the GAC?) before compiling.

Is there currently a way to test the Azure installation on a development environment? This would probably help as well.

Thank you!

Mar 31, 2011 at 10:46 AM

By the way, I also tried compiling now on a new machine, with VS newly installed and get the same results. (I'm so desperate that I'm trying anything) ;)

Apr 3, 2011 at 6:56 AM

Hi again,

Ok the problem seems to be solved now by changing the code on our custom module.

* Replaced "return Redirect(Url.EventsForAdmin());" whith "return RedirectToAction("List");"

This is -of course- unrelated to the Orchard source code... :) I appreciate you support.

Thank you!

Apr 5, 2011 at 7:33 AM

Hi Sebastien,

It seems that finally we've found a final solution. If anyone else is having the same problems, it might be worth bringing it up:

I originally followed the Orchard Azure installation instructions step by step as per this link: http://www.orchardproject.net/docs/Deploying-Orchard-to-Windows-Azure.ashx#Deploying_Orchard_to_Azure_with_optional_modules_4

However at some point I was facing this error: CS0433: The type '[Class name]' exists in both '[temp dll location 1].dll' and '[temp dll location 2].dll'

What I did was REMOVE the references to my custom modules from my Orchard.Azure.Web project, keeping only my custom modules added to the 'modules' folder. Fixed!
This of course means that you need to IGNORE this step from the instructions: 'In the project named Orchard.Azure.Web, add a reference to the newly included project'

I don't know why I was getting the error by following the instructions by the letter, but I'm sure I'm not the only one.

Hope it helps someone.