Custom feature not showing after being enabled

Jan 13, 2011 at 3:34 PM

I am experiencing strange behavior when I enable my custom module on my instance of orchard at my hosting environment. I have installed orchard 1.0.20 on both my local machine and on my hosting environment. On my local machine my module shows when enabled through features but on my hosted environment when I enable my module it does not show. Can anybody share some insights as to why this could be happening and where I could possibly start debugging as orchard runs fine and there is no error when enabling features. All dependant modules have been installed and are enabled...

Jan 13, 2011 at 3:44 PM

Can you attach a debugger and break on all managed code exceptions? It looks like something is getting swallowed.

Jan 13, 2011 at 9:55 PM

Another option is to look at the logs files in "App_Data\Logs". Most exceptions are logged in this directory by default (Note that the last active file might be locked or slightly out of date, as the file remains open and not completely flushed when the app runs).

Jan 14, 2011 at 3:49 AM
Edited Jan 14, 2011 at 3:54 AM
Hi Bertrand, not quite sure how I would go about attachining a debugger on the hosting environment as I am pretty sure they do not allow remote debugging. Renaud, here are the errors that are listed in the log file: 2011-01-13 04:32:28,022 [11] NHibernate.AdoNet.AbstractBatcher - Could not execute query: SELECT top 2 this_.Id as Id10_0_, this_.SerialNumber as SerialNu2_10_0_ FROM Settings_ShellDescriptorRecord this_ WHERE 1=1 System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'Settings_ShellDescriptorRecord'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd) 2011-01-13 04:32:28,053 [11] NHibernate.Util.ADOExceptionReporter - Invalid object name 'Settings_ShellDescriptorRecord'. 2011-01-13 04:32:28,053 [11] NHibernate.Util.ADOExceptionReporter - Invalid object name 'Settings_ShellDescriptorRecord'.
Jan 14, 2011 at 3:59 AM
Apologies for the bad formatting on previous message, damned mobile editors...
Jan 14, 2011 at 4:25 AM

I think this error is "expected" (i.e. it will be there on all Orchard installations), as this is how we detect if a database is properly initialized. Only other option I can think of is turning "debug" logging on. This can be done by editing the config\log4net.config file and restarting the site. Note the log file will get very big very fast is you set logging to "debug" or "all". This is only recommended for troubleshooting...

Jan 15, 2011 at 2:06 PM

Hi Renaud,

Here is what I found in the log file:

2011-01-14 01:23:36,793 [1] Orchard.Environment.Extensions.ExtensionLoaderCoordinator - Loaders for extension "Orchard.Phambili":
2011-01-14 01:23:36,793 [1] Orchard.Environment.Extensions.ExtensionLoaderCoordinator -   Loader: PrecompiledExtensionLoader
2011-01-14 01:23:36,793 [1] Orchard.Environment.Extensions.ExtensionLoaderCoordinator -     VirtualPath: ~/Modules/Orchard.Phambili/bin/Orchard.Phambili.dll
2011-01-14 01:23:36,793 [1] Orchard.Environment.Extensions.ExtensionLoaderCoordinator -     DateTimeUtc: 1/13/2011 1:30:59 PM
2011-01-14 01:23:36,793 [1] Orchard.Environment.Extensions.Loaders.PrecompiledExtensionLoader - Extension "Orchard.Phambili" will not be loaded as pre-compiled extension because one or more referenced extension is dynamically compiled
2011-01-14 01:23:36,793 [1] Orchard.Environment.Extensions.ExtensionLoaderCoordinator - No loader found for extension "Orchard.Phambili"!

2011-01-14 01:23:37,622 [1] Orchard.Environment.Extensions.ExtensionManager - No suitable loader found for extension "Orchard.Phambili"

2011-01-14 01:23:37,762 [1] Orchard.Environment.Extensions.Loaders.PrecompiledExtensionLoader - Loaded pre-compiled extension "Phambili": assembly name="Phambili, Version=, Culture=neutral, PublicKeyToken=null"
2011-01-14 01:23:37,762 [1] Orchard.Environment.Extensions.Loaders.PrecompiledExtensionLoader - Monitoring virtual path "~/Themes/Phambili/bin/Phambili.dll"

Jan 15, 2011 at 6:17 PM
Edited Jan 15, 2011 at 8:58 PM

I see. I think what's happening is that your module "Orchard.Phambili" depends on another module that is dynamically compiled. "Dynamically compiled" means the other module has been deployed with source code and .csproj file, and that these files have been modified or are more recent than the compiled version (the .dll in the "bin" directory of the other module). There are 3 solutions i can think of:

1) (Recommended): Deploy your module with source code and .csproj file. This is the default for packaged modules (.nupack files created by the orchard command line and loaded from the Gallery)

2) Rebuild the other module so that it's "~/Modules/<module>/bin/<module>.dll" file is more recent

3) Remove or rename the other module .csproj file "~/Modules/<module>/<module>.csproj"