Issue Command Line

Topics: Troubleshooting
Sep 25, 2012 at 1:47 PM


I juste setup Orchard v.

I follow the link Create a theme work (

It works, so I go a litte bit deeper, an try to use the command theme list available by doing help commands. Do you have any idea? Where can I find some more verbose log?

orchard> theme list /Summary:true
Error executing command "theme list"--------------------------------------------------------------------------------

Object reference not set to an instance of an object.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]   at Orchard.Themes.Commands.ThemeCommands.<List>b__3(ExtensionDescriptor d)   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)   at Orchard.Themes.Commands.ThemeCommands.List()

Best regards,


Sep 25, 2012 at 4:51 PM

I don't think you'll get something more verbose than a full stack trace but your next step is probably to attach a debugger to orchard.exe and inspect that exception closer.

Sep 25, 2012 at 8:07 PM


Good idea :)

I attached to the debugger, by attaching to cmd launching orchard.exe.

The issue is produced by the line because Tags contain nothing. I put the line in comment and it works. (C:\Orchard\src\Orchard.Web\Modules\Orchard.Themes\Commands\ThemeCommands.cs)


- [6] {Orchard.Environment.Extensions.Models.ExtensionDescriptor} Orchard.Environment.Extensions.Models.ExtensionDescriptor AntiForgery "enabled" string Author "The Orchard Team" string BaseTheme null string Description "The ArchiveLater module introduces scheduled archiving functionality." string ExtensionType "Module" string+ Features Count = 1 System.Collections.Generic.IEnumerable<Orchard.Environment.Extensions.Models.FeatureDescriptor> {System.Collections.Generic.List<Orchard.Environment.Extensions.Models.FeatureDescriptor>} Id "Orchard.ArchiveLater" string Location "~/Modules" string Name "Archive Later" string OrchardVersion "1.4.2" string Path "ArchiveLater" string Tags null string Version "1.4.2" string WebSite "" string Zones null string

        [CommandName("theme list")]
        [CommandHelp("theme list [/Summary:true|false]" + "\r\n\tDisplay list of available themes")]
        public void List() {
            var currentTheme = _siteThemeService.GetSiteTheme();
            var featuresThatNeedUpdate = _dataMigrationManager.GetFeaturesThatNeedUpdate();

            var themes = _extensionManager.AvailableExtensions()
                .Where(d => DefaultExtensionTypes.IsTheme(d.ExtensionType))
                .Where(d => d.Tags.Split(',').Any(t => t.Trim().Equals("hidden", StringComparison.OrdinalIgnoreCase)) == false)
                .Select(d => new ThemeEntry {
                    Descriptor = d,
                    NeedsUpdate = featuresThatNeedUpdate.Contains(d.Id),
                    Enabled = _shellDescriptor.Features.Any(sf => sf.Name == d.Id)

Best regards,


Sep 25, 2012 at 11:13 PM

Ah, that would explain it. Can you please file a bug?

Sep 26, 2012 at 7:30 AM


It's done,

Best regards,