Publishing a website

Topics: Writing modules
Jul 12, 2012 at 10:43 AM

Hey everyone,

I have a question about publishing, I'm using the brand new websites feauture in Azure,

You have to install the azure sdk for visual studio, download a publish profile from your created site and just publish your web folder, it's realy cool.

But the problem I have is that if a publish in debug the site is 840MB, when i publish in release the site is 12mb (which doesn't work)

What am I doing wrong in VS that my release folder is so small?

Borrie

Coordinator
Jul 12, 2012 at 6:30 PM

I don't know. Please explain how you created the deployment file.

Jul 12, 2012 at 10:33 PM

I download the publish profile for the new created website from my newly created azure website. Publish it in visual studio 2010 
(right click on webfolder using the azure sdk for visual studio) and import that profile.
Everything goes well but it only uploads 12MB of data which off course doesn't work.

It seems like it compiles only a few dll's (in my project options for release all my modules are checked). When I publish in debug mode the site works but it uploads 840MB which is way to much.. How can I get it to publish correctly in Release mode? When I check my release folder it's also only 12mb big so I think the problem is in the compiling while in release publish mode. This is the output when publishing via release, like you can see only a few things get compiled: ------ Build started: Project: Orchard.Framework, Configuration: Release Any CPU ------ Orchard.Framework -> C:\Documents and Settings\wim\My Documents\Visual Studio 2010\Projects\CLB_AALS_Synched\src\Orchard\bin\Release\Orchard.Framework.dll ------ Build started: Project: Orchard.WarmupStarter, Configuration: Release Any CPU ------ Orchard.WarmupStarter -> C:\Documents and Settings\wim\My Documents\Visual Studio 2010\Projects\CLB_AALS_Synched\src\Orchard.WarmupStarter\bin\Release\Orchard.WarmupStarter.dll ------ Build started: Project: Orchard, Configuration: Release Any CPU ------ Orchard -> C:\Documents and Settings\wim\My Documents\Visual Studio 2010\Projects\CLB_AALS_Synched\src\Tools\Orchard\bin\Release\Orchard.exe ------ Build started: Project: Orchard.Core, Configuration: Release Any CPU ------ Orchard.Core -> C:\Documents and Settings\wim\My Documents\Visual Studio 2010\Projects\CLB_AALS_Synched\src\Orchard.Web\Core\bin\Orchard.Core.dll ------ Build started: Project: Orchard.Web, Configuration: Release Any CPU ------ Orchard.Web -> C:\Documents and Settings\wim\My Documents\Visual Studio 2010\Projects\CLB_AALS_Synched\src\Orchard.Web\bin\Orchard.Web.dll ------ Publish started: Project: Orchard.Web, Configuration: Release Any CPU ------ Auto ConnectionString Transformed Web.config into obj\Release\CSAutoParameterize\transformed\Web.config. Copying all files to temporary location below for package/publish: obj\Release\Package\PackageTmp. Start Web Deploy Publish the Application/package to https://waws-prod-am2-001.publish.azurewebsites.windows.net/msdeploy.axd?site=clbaalst ... Updating createApp (clbaalst). Adding child dirPath (clbaalst\bin). Adding child dirPath (clbaalst\Config). Adding child dirPath (clbaalst\Media). Updating setAcl (clbaalst). Updating setAcl (clbaalst). Adding child filePath (clbaalst\bin\Antlr3.Runtime.dll). Adding child filePath (clbaalst\bin\Autofac.Configuration.dll). Adding child filePath (clbaalst\bin\Autofac.dll). Adding child filePath (clbaalst\bin\Autofac.Integration.Mvc.dll). Adding child filePath (clbaalst\bin\Autofac.Integration.Web.dll). Adding child filePath (clbaalst\bin\Autofac.xml). Adding child filePath (clbaalst\bin\Castle.Core.dll). Adding child filePath (clbaalst\bin\Castle.Core.xml). Adding child filePath (clbaalst\bin\Castle.DynamicProxy2.dll). Adding child filePath (clbaalst\bin\Castle.DynamicProxy2.xml). Adding child filePath (clbaalst\bin\ClaySharp.dll). Adding child filePath (clbaalst\bin\FluentNHibernate.dll). Adding child filePath (clbaalst\bin\FluentNHibernate.xml). Adding child filePath (clbaalst\bin\Iesi.Collections.dll). Adding child filePath (clbaalst\bin\Iesi.Collections.xml). Adding child filePath (clbaalst\bin\log4net.dll). Adding child filePath (clbaalst\bin\log4net.xml). Adding child filePath (clbaalst\bin\Microsoft.Web.Infrastructure.dll). Adding child filePath (clbaalst\bin\NHibernate.ByteCode.Castle.dll). Adding child filePath (clbaalst\bin\NHibernate.ByteCode.Castle.xml). Adding child filePath (clbaalst\bin\NHibernate.dll). Adding child filePath (clbaalst\bin\NHibernate.Linq.dll). Adding child filePath (clbaalst\bin\NHibernate.Linq.xml). Adding child filePath (clbaalst\bin\NHibernate.xml). Adding child filePath (clbaalst\bin\NuGet.Core.dll). Adding child filePath (clbaalst\bin\Orchard.Core.dll). Adding child filePath (clbaalst\bin\Orchard.exe). Adding child filePath (clbaalst\bin\Orchard.Framework.dll). Adding child filePath (clbaalst\bin\Orchard.WarmupStarter.dll). Adding child filePath (clbaalst\bin\Orchard.Web.dll). Adding child filePath (clbaalst\bin\System.Data.SqlServerCe.dll). Adding child filePath (clbaalst\bin\System.Web.Helpers.dll). Adding child filePath (clbaalst\bin\System.Web.Mvc.dll). Adding child filePath (clbaalst\bin\System.Web.Mvc.xml). Adding child filePath (clbaalst\bin\System.Web.Razor.dll). Adding child filePath (clbaalst\bin\System.Web.WebPages.Deployment.dll). Adding child filePath (clbaalst\bin\System.Web.WebPages.dll). Adding child filePath (clbaalst\bin\System.Web.WebPages.Razor.dll). Adding child filePath (clbaalst\Config\log4net.config). Adding child filePath (clbaalst\Config\Sample.Host.config). Adding child filePath (clbaalst\Config\Sample.HostComponents.config). Adding child filePath (clbaalst\Global.asax). Adding child filePath (clbaalst\Media\OrchardLogo.png). Adding child filePath (clbaalst\Refresh.html). Adding child filePath (clbaalst\Web.config). Updating setAcl (clbaalst). Updating setAcl (clbaalst). Publish is successfully deployed. Site was published successfully http://clbaalst.azurewebsites.net/ ========== Build: 5 succeeded or up-to-date, 0 failed, 0 skipped ========== ========== Publish: 1 succeeded, 0 failed, 0 skipped ==========

Coordinator
Jul 12, 2012 at 10:58 PM

Please file a bug.

Jul 13, 2012 at 7:53 AM

Betrand,

This is not an Orchard bug I think, it's the way the release is compiled using the azure publish.

Borrie

Coordinator
Jul 13, 2012 at 11:06 AM

It is: we have special configuration in the project infrastructure that tells VS how to build the deployment packages. It seems like this fails in your particular configuration and should be fixed. Please file a bug.

Jul 13, 2012 at 12:06 PM

Bertrand,

Isn't there a way I can import this configuration in my visual studio project? I've just created a new 1.5 project and it's still the same.

(It's not that I don't want to file a bug :) I'm just looking for way to quickly solve this)

Borrie

Coordinator
Jul 13, 2012 at 12:08 PM
Edited Jul 13, 2012 at 12:09 PM

I don't understand what you mean. It should already work.

But there are other ways to deploy to Azure. Look at the doc topic, and at the article that is linked at the bottom.

Jul 13, 2012 at 1:01 PM

Bertrand,

When I publish an Orchard website from visual studio, what options should I define in the properties of my Orchard.Web folder?

Like the answer from here: http://stackoverflow.com/questions/8632794/why-visual-studio-2010-publish-website-with-source-code

When I choose only files needed for this application i only get an output of 12MB, when I choose all files in this project folder it's 840MB...

Borrie

Coordinator
Jul 13, 2012 at 1:42 PM

The way I do it is that I right-click the Orchard.Web project, then select "Build Deployment Package" after I switched the build to release in Configuration Manager. I don't configure anything in particular before I do that. Once I've done that, I deploy the resulting package from the IIS Manager console, which gives me a lot of flexibility on what exactly I deploy, but the whole package is 23.8MB in size.

When I deploy on Azure, I usually just run ClickToBuildAzure from a command prompt and follow the instructions in the Azure doc topic.

Jul 13, 2012 at 2:49 PM

Bertrand,

I've been able to narrow down the problem:

In VS I've right clicked the Orchard.Web folder, selected Project dependencies and selected all my modules needed.

When I publish to file system everything is there and my final published project is around 60MB which is fine.

Now when I publish and choose web deploy with the downloaded azure profile it only publishes like 16MB and I only have the bin config and media folder.

Which is realy weird because the publish settings for release stay exectly the same. When the site starts it als gives this error: (because the project seems to be half compiled)

Server Error in '/' Application.

None of the constructors found with 'Public binding flags' on type 'Orchard.Environment.DefaultOrchardShell' can be invoked with the available services and parameters:
Cannot resolve parameter 'Orchard.Mvc.Routes.IRoutePublisher routePublisher' of constructor 'Void .ctor(System.Func`1[Autofac.Features.OwnedInstances.Owned`1[Orchard.Environment.IOrchardShellEvents]], System.Collections.Generic.IEnumerable`1[Orchard.Mvc.Routes.IRouteProvider], Orchard.Mvc.Routes.IRoutePublisher, System.Collections.Generic.IEnumerable`1[Orchard.Mvc.ModelBinders.IModelBinderProvider], Orchard.Mvc.ModelBinders.IModelBinderPublisher, Orchard.Tasks.ISweepGenerator)'.

Coordinator
Jul 13, 2012 at 3:55 PM

So can you explain why you don't just follow the procedure in the docs?

Jul 13, 2012 at 4:12 PM

Well, because I'm working on windows xp and xp isn't supported anymore for the azure sdk and azure tools... (i can install a few components but not everything)

That's why I'm looking for an alternative way, it still remains really weird why file system publish works fine and web deploy doesn't...

Borrie

Coordinator
Jul 13, 2012 at 4:16 PM

Oh wow, Windows XP, well, condolences. If you dig into the web deploy package, it's not hard to find the files you need to deploy if file system deploy works for you, something like Content\C_C\Projects\harvest\src\Orchard.Web\obj\Release\Package\PackageTmp. It's just a zip file after all.

Jul 13, 2012 at 4:34 PM

Thanks for feeling my pain, life is hard on xp :)

I've just opened the publish profile file from my azure website and I see this: publishMethod="MSDeploy"

Maybe I should change that?

Borrie

Coordinator
Jul 13, 2012 at 5:05 PM

You can use FTP now with Azure. I would use that directly if MS Deploy doesn't work like you want it to.

Jul 13, 2012 at 5:07 PM

Betrand,

I was thinking the same, I'll try ftp, my msdeploy is seriously messed up + this is beyond the orchard scope.

Thanks for all your help! Please pray with me that they will soon enroll e newer version of windows here at my job :)

Borrie

Jul 14, 2012 at 1:41 PM

Betrand,

The ftp publish worked! But the site is really slow, I've seen a few people also complain about this that Orchard is really slow on azure website preview.

Do you know what could be wrong?

Borrie

Coordinator
Jul 16, 2012 at 10:01 PM

Please try to disable dynamic compilation by opening the config folder. and editing the host component file. You will see a "Disable" attribute, put it to true.

Jul 16, 2012 at 11:13 PM

Sebastien,

Do you mean in the Orchard.Web/Config folder the file Sample.HostComponents.config?

This value is already set to true.

 

<?xml version="1.0" encoding="utf-8" ?>
<HostComponents>
  <Components>
    <Component Type="Orchard.Environment.Extensions.Loaders.DynamicExtensionLoader">
      <Properties>
        <Property Name="Disabled" Value="true"/>
      </Properties>
    </Component>
  </Components>
</HostComponents>

Coordinator
Jul 16, 2012 at 11:14 PM

Yes, rename it to HostComponents.config then

Jul 17, 2012 at 12:28 AM

Sebastien,

That did it! The site is fast now!!

Thank you so much!

I have one last question about publishing, should I check the precompile this application before publishing?

Kind regards,

Borrie

Coordinator
Jul 17, 2012 at 12:51 AM

After it would be too late, no ?

Jul 17, 2012 at 8:25 AM

Well and if I do a new publish?