debugging what a module as it installs

Topics: Customizing Orchard, Troubleshooting, Writing modules
Apr 16, 2013 at 3:07 PM
Edited Apr 16, 2013 at 3:09 PM
Hi

I am having problems with Orchard. I am a lone developer with all the faults that that entails.

Essentially, I want to be able to debug a module as it installs to see why it doesn't even run the migrations.

Said module works fine in the Orchard source code installation it was developed in. But package it up and try to install the package and although it says everything is OK, it just isn't there. Checking the database, I find that the migrations haven't run.

So, how do I go about debugging this? What strategy do I apply, eg, do I start with a clean Source Code installation and try to install the package? If so, where do I set a break point so I can follow what happens (I won't be able to put a break point in the package source obviously).

Etc, etc.

Please note that I don't work in an enterprise environment.

Andrew
Apr 16, 2013 at 3:57 PM
You have enabled the Migrations module in the backend?
Apr 16, 2013 at 4:37 PM
No... surely I don't need to enable migrations...? What does the Migrations Module do? Are migrations locked down by default in 1.6??
Apr 17, 2013 at 1:15 AM
Have you checked the error logs?

Does your application have the correct permissions?


And the migrations module just contains commands to run migrations from the command line :)
Apr 17, 2013 at 8:42 AM
Hazza

There is nothing in the error logs, just empty files with the date. No text.

Everything else works and other modules install correctly, so I am presuming I have the correct permissions.

Thanks for clearing up the migrations module confusion. I am not using the command line for this, I'm trying to install the package the normal way.

Thanks for trying

Andrew
Apr 17, 2013 at 8:47 AM
Yes, that is strange. Have you tried packaging the module and then installing it on a local copy?
Apr 17, 2013 at 8:57 AM
Edited Apr 17, 2013 at 8:57 AM
Well, I think it is unlikely to be a problem with your migrations file if it works on your development copy.

But if you do want to debug the migrations you may want to start in Orchard.Framework/Data/Migration/Generation/SchemaCommandGenerator.cs
Apr 17, 2013 at 9:39 AM
Hazza

Thanks your time.

Yes, I have created packages and tried installing locally.

The module worked fine until I installed mvc 4 on the server (and by implication, .NET 4.5).

I am also not able to get Nick Mayne's forums to show up in the admin menu when installed.

I think there is an issue with Orchard and .NET 4.5. No errors in the log, nothing to go by. Have you heard of any such problem?
Apr 17, 2013 at 1:37 PM
Orchard works fine with .NET 4.5 if I remember correctly. However, not all modules do. Is your local machine running .NET 4.5? There are issues with some things like HttpContext, HttpRequest and HttpResponse I think. As for forums module, I'm not really sure how stable the gallery version of Nicks module is, you may want to try his latest source code.

Check what is new 4.5 here, kinda long ^^ http://www.asp.net/vnext/overview/aspnet/whats-new