From 2211deb1160e57c26048d158e7d3901a44fcee67 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Mon, 11 Oct 2010 18:04:41 -0700 Subject: [PATCH] Working on Azure --HG-- branch : dev --- AzurePackage.proj | 10 +- .../Orchard.Azure.CloudService.sln | 35 ++++++ .../Orchard.Azure.Web/Global.asax.cs | 70 +----------- .../Orchard.Azure.Web.csproj | 104 ++++-------------- .../Orchard.Azure.Web/Web.config | 16 +-- 5 files changed, 69 insertions(+), 166 deletions(-) diff --git a/AzurePackage.proj b/AzurePackage.proj index d776806b3..696168b1e 100644 --- a/AzurePackage.proj +++ b/AzurePackage.proj @@ -75,7 +75,7 @@ - + @@ -98,14 +98,6 @@ - - - - loadedMvcVersion != allowed) ) { - string message; - if ( loadedMvcAssembly.GlobalAssemblyCache ) { - message = string.Format( - "Orchard has been deployed with a version of {0} that has a different file version ({1}) " + - "than the version installed in the GAC ({2}).\r\n" + - "This implies that Orchard will not be able to run properly in this machine configuration.\r\n" + - "Please un-install MVC from the GAC or install a more recent version.", - loadedMvcAssembly.GetName().Name, - allowedVersions.First(), - loadedMvcVersion); - } - else { - message = string.Format( - "Orchard has been configured to run with a file version {1} of \"{0}\" " + - "but the version deployed with the application is {2}.\r\n" + - "This probably implies that Orchard is deployed with a newer version " + - "and the source code hasn't been updated accordingly.\r\n" + - "Update the Orchard.Web application source code (look for \"CheckMvcVersion\") to " + - "specify the correct file version number.\r\n", - loadedMvcAssembly.GetName().Name, - allowedVersions.First(), - loadedMvcVersion); - } - - throw new HttpException(500, message); - } + static void MvcSingletons(ContainerBuilder builder) { + builder.Register(ctx => RouteTable.Routes).SingleInstance(); + builder.Register(ctx => ModelBinders.Binders).SingleInstance(); + builder.Register(ctx => ViewEngines.Engines).SingleInstance(); } - private static Version ReadAssemblyFileVersion(Assembly assembly) { - object[] attributes = assembly.GetCustomAttributes(typeof(AssemblyFileVersionAttribute), true); - if ( attributes == null || attributes.Length != 1 ) { - string message = string.Format("Assembly \"{0}\" doesn't have a \"{1}\" attribute", - assembly.GetName().Name, typeof(AssemblyFileVersionAttribute).FullName); - throw new FileLoadException(message); - } - - var attribute = (AssemblyFileVersionAttribute)attributes[0]; - return new Version(attribute.Version); - } - - - protected void MvcSingletons(ContainerBuilder builder) { - builder.RegisterInstance(ControllerBuilder.Current); - builder.RegisterInstance(RouteTable.Routes); - builder.RegisterInstance(ModelBinders.Binders); - builder.RegisterInstance(ModelMetadataProviders.Current); - builder.RegisterInstance(ViewEngines.Engines); - } } } diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj b/src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj index e83783e99..c9cd6af6e 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj +++ b/src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj @@ -44,7 +44,7 @@ False ..\..\..\lib\autofac\Autofac.dll - + False ..\..\..\lib\autofac\Autofac.Configuration.dll @@ -54,17 +54,6 @@ ..\..\..\lib\autofac\Autofac.Integration.Web.Mvc.dll - - False - ..\..\..\lib\Castle Windsor 2.0\bin\Castle.Core.dll - - - False - ..\..\..\lib\Castle Windsor 2.0\bin\Castle.DynamicProxy2.dll - - - False - False @@ -102,6 +91,9 @@ False + + ..\..\..\lib\aspnetmvc\System.Web.Helpers.dll + False ..\..\..\lib\aspnetmvc\System.Web.Mvc.dll @@ -116,9 +108,18 @@ False + + ..\..\..\lib\aspnetmvc\System.Web.Razor.dll + False + + ..\..\..\lib\aspnetmvc\System.Web.WebPages.dll + + + ..\..\..\lib\aspnetmvc\System.Web.WebPages.Razor.dll + False @@ -137,6 +138,9 @@ False + + ..\..\..\lib\aspnetmvc\WebMatrix.Data.dll + @@ -166,83 +170,15 @@ {9916839C-39FC-4CEB-A5AF-89CA7E87119F} Orchard.Core - - {D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D} - Lucene - - - {63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867} - Orchard.Blogs - - - {C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962} - Orchard.CodeGeneration - - - {14C049FD-B35B-415A-A824-87F26B26E7FD} - Orchard.Comments - - - {0E7646E8-FE8F-43C1-8799-D97860925EC4} - Orchard.ContentTypes - - - {AB3C207C-0126-4143-8D62-1119DF80D366} - Orchard.Experimental - - - {EA2B9121-EF54-40A6-A53E-6593C86EE696} - Orchard.Indexing - - - {D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB} - Orchard.Media - - - {17F86780-9A1F-4AA1-86F1-875EEC2730C7} - Orchard.Modules - - - {72457126-E118-4171-A08F-9A709EE4B7FC} - Orchard.MultiTenancy - - - {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059} - Orchard.Packaging - - - {D10AD48F-407D-4DB5-A328-173EC7CB010F} - Orchard.Roles - - - {4BE4EB01-AC56-4048-924E-2CA77F509ABA} - Orchard.Search - - - {8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4} - Orchard.Setup - - - {5D0F00F0-26C9-4785-AD61-B85710C60EB0} - Orchard.Tags - - - {CDE24A24-01D3-403C-84B9-37722E18DFB7} - Orchard.Themes - - - {79AED36E-ABD0-4747-93D3-8722B042454B} - Orchard.Users - - - {954CA994-D204-468B-9D69-51F6AD3E1C29} - TinyMce - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} Orchard.Framework False + + {33B1BC8D-E292-4972-A363-22056B207156} + Orchard + {2505AA84-65A6-43D0-9C27-4F44FD576284} Orchard.Azure diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Web.config b/src/Orchard.Azure/Orchard.Azure.Web/Web.config index 111739ab3..fdcfa7711 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Web.config +++ b/src/Orchard.Azure/Orchard.Azure.Web/Web.config @@ -9,17 +9,17 @@ --> - -
-
+ +
+
- + - - + + @@ -31,7 +31,7 @@ - +