Getting crazy on first orchard Deploy, pelase save my life!

Topics: Administration, Installing Orchard, Troubleshooting
Jan 23, 2014 at 4:10 PM
Hello Gentlemen,
please help on this. I get a server error 500 trying to browse my Orchard application from the IIS management console itself. Don't know what was wrong.

Here're my steps.
On my pc.
1) visual studio command prompt (as admin) -> ClickToBuild.cmd. Ok. no errors no warnings.
Configuration was Release.
2) package created on artifacts/MsDeploy/Orchard.Web.zip -> replaced the empty App_data in the zip with the one of my dev environment (as to keep my settings and database, sql ce this time).
3) passed the zip through a shared folder.

On the server, via remote desktop connection...
1) Zip package taken from the shared folder my dev environment, and copied on the desktop.
2) In IIS 7 (7.5.7600.16385) on Win Server 2008 R2 SP1, right click on Default Web Site -> Deploy -> Import Application -> selected the above package.
3) Everything left as is. Next.
4) No database selected. Next.
5) I give the app the same name of the dev environment one. Next. The installation starts... Package Installed Successfully. Finish.
6) App is created. I give full access to App_data and Media folders for users IIS_IUSRS, Users and .net4.0-integrated.
7) In advance settings I check that the app pool mode is .NET 4.0, integrated.
8) From the app pool settings I've enabled... then disabled again the 32-Bit Applications. There is no difference, I always get a http 500.
9) Finally, I browse the app from IIS Manager, and I get the error page.

I really don't know what's wrong. The IIS of my dev machine has exactly the same subcomponents installed, the name of the webapp is the same, the database is sqlce, so imported through the App_data folder, the app pool is .net4.0-integrated.

Please help as I don't know what to do.

I've read all the following articles.
http://docs.orchardproject.net/Documentation/Building-and-deploying-Orchard-from-a-source-code-drop
http://stefantsov.com/2011/july/msbuild-and-msdeploy-for-orchard#.UuE83rQVklN
http://stackoverflow.com/questions/6404330/how-to-deploy-an-orchard-cms-site-including-all-settings-and-content-from-devel
https://orchard.codeplex.com/discussions/252775
https://orchard.codeplex.com/discussions/359318
Jan 24, 2014 at 3:30 PM
I noticed on step 6 you didn't mention giving write privileges to the Modules Folder and Themes Folders. That's important.

See "Running the Site Using IIS" at

http://docs.orchardproject.net/Documentation/Manually-installing-Orchard-zip-file

More importantly, however, go into the App_Data > Logs Folder and look to see if Orchard logged an error.


Regards,

Dave
Jan 24, 2014 at 4:32 PM
First of all thanks for your help Dave.
During the day I made some progress and I've ended on reinstalling the .net framework 4.0 again (as I was not gathering any result not from Orchard, nor from any kind on asp.net application).
Now I've managed to get some web app installed so I'm sure IIS is now well set up.

In fact at the moment the problem with Orchard has changed. I've installed it again as a web app, and when trying to start the app I get the following error.
Server Error in '/cc4ges' Application.
--------------------------------------------------------------------------------

Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047) 
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.IO.FileLoadException: Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
 
Stack Trace: 

[FileLoadException: Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)]
   Autofac.Builder.RegistrationData..ctor(Service defaultService) in c:\Projects\OSS\autofac\Core\Source\Autofac\Builder\RegistrationData.cs:63
   Autofac.Builder.RegistrationBuilder`3..ctor(Service defaultService, TActivatorData activatorData, TRegistrationStyle style) in c:\Projects\OSS\autofac\Core\Source\Autofac\Builder\RegistrationBuilderOfTLAR.cs:51
   Autofac.Builder.RegistrationBuilder.ForType() in c:\Projects\OSS\autofac\Core\Source\Autofac\Builder\RegistrationBuilder.cs:61
   Autofac.RegistrationExtensions.RegisterType(ContainerBuilder builder) in c:\Projects\OSS\autofac\Core\Source\Autofac\RegistrationExtensions.cs:192
   Orchard.Environment.OrchardStarter.CreateHostContainer(Action`1 registrations) in K:\Orchard.Development\Orchard.MSFD\src\Orchard\Environment\OrchardStarter.cs:46
   Orchard.Web.MvcApplication.HostInitialization(HttpApplication application) in k:\Orchard.Development\Orchard.MSFD\src\Orchard.Web\Global.asax.cs:48
   Orchard.WarmupStarter.<>c__DisplayClass3.<LaunchStartupThread>b__2(Object state) in K:\Orchard.Development\Orchard.MSFD\src\Orchard.WarmupStarter\Starter.cs:89

[ApplicationException: Error during application initialization]
   Orchard.WarmupStarter.Starter`1.OnBeginRequest(HttpApplication application) in K:\Orchard.Development\Orchard.MSFD\src\Orchard.WarmupStarter\Starter.cs:63

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +0
   System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +152
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +393
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +38
   System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +35
   System.Web.Util.ArglessEventHandlerProxy.Callback(Object sender, EventArgs e) +74
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +266

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 
I'm trying to run a zip package made using the ClickToBuild.cmd present at the Orchard root dir, not a complete source code zip release from Orchard.

Any help on this would be really appreciated.

Thanks.

Fabio
Jan 24, 2014 at 5:02 PM
Watching at this part of the error message...
Autofac.Builder.RegistrationData..ctor(Service defaultService) in c:\Projects\OSS\autofac\Core\Source\Autofac\Builder\RegistrationData.cs:63
   Autofac.Builder.RegistrationBuilder`3..ctor(Service defaultService, TActivatorData activatorData, TRegistrationStyle style) in c:\Projects\OSS\autofac\Core\Source\Autofac\Builder\RegistrationBuilderOfTLAR.cs:51
   Autofac.Builder.RegistrationBuilder.ForType() in c:\Projects\OSS\autofac\Core\Source\Autofac\Builder\RegistrationBuilder.cs:61
   Autofac.RegistrationExtensions.RegisterType(ContainerBuilder builder) in c:\Projects\OSS\autofac\Core\Source\Autofac\RegistrationExtensions.cs:192
   Orchard.Environment.OrchardStarter.CreateHostContainer(Action`1 registrations) in K:\Orchard.Development\Orchard.MSFD\src\Orchard\Environment\OrchardStarter.cs:46
   Orchard.Web.MvcApplication.HostInitialization(HttpApplication application) in k:\Orchard.Development\Orchard.MSFD\src\Orchard.Web\Global.asax.cs:48
   Orchard.WarmupStarter.<>c__DisplayClass3.<LaunchStartupThread>b__2(Object state) in K:\Orchard.Development\Orchard.MSFD\src\Orchard.WarmupStarter\Starter.cs:89

[ApplicationException: Error during application initialization]
   Orchard.WarmupStarter.Starter`1.OnBeginRequest(HttpApplication application) in K:\Orchard.Development\Orchard.MSFD\src\Orchard.WarmupStarter\Starter.cs:63
...it seems that my package is referencing some source code in my dev path, that in turn is not there, of course.

Any experience/idea on this?

Many thanks again.

Fabio.
Jan 27, 2014 at 4:06 PM
Ok.
I did cut and past of the error heading on google, then I went through stackoverflow and I ended up finding the solution here.

http://code.google.com/p/autofac/wiki/FrequentlyAskedQuestions

Since Autofac is a Portable Class Library, there needs to install a patch on the server in order to make such kind of library on .net 4.0 app pools.
The patch is not included in the .net framework download.
Marked as answer by edtruant on 1/27/2014 at 8:06 AM