This project is read-only.

Deployed Azure package successfully, but 'log4net' assembly is missing when I run.

Topics: General, Installing Orchard, Troubleshooting
Mar 29, 2012 at 10:51 PM
Edited Mar 29, 2012 at 11:01 PM

Hi all,

I built my Orchard project (which has a custom theme) using the ClickToBuildAzurePackage.cmd and the latest source code. When I pushed it to Azure, the deployment went well and all but I am getting a missing assembly error when I run it. It looks like the package didn't include the Log4Net assembly correctly. The question is, which project in the Orchard.Azure.sln solution do I need to add this to?

Could not load file or assembly 'log4net, Version=, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The system cannot find the file specified.


The following might also help.


[HttpException (0x80004005): An exception was thrown while invoking the constructor 'Void .ctor(Orchard.Environment.IHostEnvironment)' on type 'OrchardLog4netFactory'.]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +4056837
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +191
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +352
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375

[HttpException (0x80004005): An exception was thrown while invoking the constructor 'Void .ctor(Orchard.Environment.IHostEnvironment)' on type 'OrchardLog4netFactory'.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11700592
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4868789

Mar 30, 2012 at 2:00 AM

Figured it out. I added the assembly reference to the Orchard.Azure.Web project and set the Copy Local property to true. Repackaged and voila!