A IDockManager Extension must be included because a UI was found

May 14, 2014 at 9:38 AM
I got a error message after I have started the "DemoMap.exe" in the DotSpatial.Full of version 1.6. The DemoMap was unable to start.
Could you tell me how to fix it?
Developer
May 14, 2014 at 10:32 AM
It seems that some files missing in your folder. Try to unpack DotSpatial.Full to new folder again. This error mean that DotSpatial.Plugins.TabbedDocking.dll not found in "Windows Extensions" folder.
May 15, 2014 at 1:26 AM
I found that the file, DotSpatial.Plugins.TabbedDocking.dll presented in the "Windows Extensions" folder. The DemoMap.exe started without any toolbar buttons. Can you help me.
May 15, 2014 at 4:18 PM
Does the demomap.exe search for dependencies (DotSpatial dlls, plugins and other needed files ) only in the current dir and sub dirs? or somewhere else? is this a hard-coded setting?
Thanks
Developer
May 15, 2014 at 4:48 PM
Yes, by default only in the current dir and sub dirs with some restrictions:
  • all core dlls must be in current dir (near main exe)
  • plugins can be in current dir or in sub dirs with names "Application Extensions", "Plugins", "Windows Extensions", "Mono Extensions" (when running on Mono), "Data Extensions", "Tools".
    Any plugin can be in separate folder - e.g.
    -- Plugins
    --- Plugin1Folder
    ---- plugin1.dll
    --- Plugin2Folder
    ---- plugin2.dll
  • You can add more directories to search plugins using AppManager.Directories property.
May 16, 2014 at 3:03 PM
There are random failures when starting the DemoMap.exe (DotSpatial.Full of version 1.6) on my end (win7 x64, mainstream cpu with 8GB mem).
Sometimes it prompts the same error as this thread's title, and sometimes it prompts other errors.
Moreover, a 'successful' launching occasionally takes 2-3 minutes to open the main window.
I suspect that some plugins cause this issue or delay.
Could you please list the minimum requirments on cores/plugins/tools/extensions?
I just want to improve the start-up time for a quick testing and debugging on my customized plugin.
Thanks
Developer
May 16, 2014 at 3:43 PM
You can remove all dlls in folders: "Application Extensions", "Mono Extensions", "Plugins". And all dlls except DotSpatial.Plugins.MenuBar.dll, DotSpatial.Plugins.SimpleHeaderControl.dll, DotSpatial.Plugins.TabbedDocking.dll in Windows Extensions folder.
May 16, 2014 at 4:38 PM
Edited May 16, 2014 at 4:51 PM
It works! the demomap.exe starts in only a moment and my customized plugin is loaded successfully
thanks!
Oct 16, 2014 at 10:57 AM
Edited Oct 16, 2014 at 11:00 AM
Hi all,
I use Dotspatial 1.7 Full. I also get the same error message when I create a new Project and try to run it. But if I copy DemoMap.exe to the application folder and run it, no error popup. Could you tell me why please? And please help me to ignore the error message? My step by step as following:
  1. I create new Solution with a Project WindowForm. And add Appmanager1 to my Form
  2. Write some code in my Form1:
Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        AppManager1.LoadExtensions()

    End Sub
.3. Add references: DotSpatial.Controls; DotSpatial.Data; DotSpatial.Symbology.
.4. Copy all files and folders from Dotspatial 1.7 Full into my application path and try to Run ==>> I get error "A IDockManager Extension must be included because a UI was found".... But I run the DemoMap.exe in the same folder, no error popup. Could you tell me why please? And please help me to ignore the error message?

Thank you for your help
Brg

GIS4SD
Oct 17, 2014 at 9:03 AM
Hi Brg

since version 1.7 something changed as you may read in this issue I raised some time ago.
Maybe you can take advantage of some information reported in that issue by Mogikanin

I made myself a class with dummy header, docking and status and now it works

I don't know if this could solve your problem.

In case my code is the following (just empty dummy classes)

the project is named "DummyHeaderControl" but contains the three classes below

code for status control is:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using DotSpatial.Data;
using DotSpatial.Controls.Extensions;
using DotSpatial.Controls.Header;

namespace DummyHeaderControl
{

     /// <summary>
        /// Used to display status information.
        /// </summary>
        [InheritedExport]
        public interface IStatusControl : IProgressHandler
        {
            /// <summary>
            /// Adds the specified panel.
            /// </summary>
            /// <param name="panel">The panel.</param>
            void Add(StatusPanel panel);

            /// <summary>
            /// Removes the specified panel.
            /// </summary>
            /// <param name="panel">The panel.</param>
            void Remove(StatusPanel panel);
        }
    
}
for dock manager is:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DotSpatial.Controls.Header;
using DotSpatial.Controls.Docking;
using System.ComponentModel.Composition;

namespace DummyHeaderControl
{
    [Export(typeof(IDockManager))]
    public class DummyDockManager : IDockManager
    {

        public void Add(DockablePanel item)
        {

        }

        public void ResetLayout()
        {
        
        }

        public void Remove(string key)
        {

        }

        public void SelectPanel(string key)
        {

        }

        public void HidePanel(string key)
        {

        }

        public void ShowPanel(string key)
        {

        }

        //public interface ActivePanelChanged
        //{
        //}

        public event EventHandler<DockablePanelEventArgs> ActivePanelChanged;
        public event EventHandler<DockablePanelEventArgs> PanelClosed;
        public event EventHandler<DockablePanelEventArgs> PanelAdded;
        public event EventHandler<DockablePanelEventArgs> PanelRemoved;
        public event EventHandler<DockablePanelEventArgs> PanelHidden;



        //public void RemoveAll()
        //{

        //}

        //public void SelectRoot(string key)
        //{

        //}

        //public event EventHandler<RootItemEventArgs> RootItemSelected;
    }

}
for header controls is:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DotSpatial.Controls.Header;
using System.ComponentModel.Composition;

namespace DummyHeaderControl
{
    [Export(typeof(IHeaderControl))]
    public class DummyHeaderControl : IHeaderControl
    {
        public void Add(HeaderItem item)
        {

        }

        public void Remove(string key)
        {

        }

        public void RemoveAll()
        {

        }

        public void SelectRoot(string key)
        {

        }

        public event EventHandler<RootItemEventArgs> RootItemSelected;
    }
}
Hope this helps

Oscar
Oct 17, 2014 at 9:32 AM
Edited Oct 17, 2014 at 9:34 AM
Thank Oscar for your help.

I am VB.net user and try to translate your code to VB.net and get some error as in attached images. Could you please help me to pass this?
Image
Image

here is my VB code which translated from your C#

STATUS CONTROL:
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.ComponentModel.Composition
Imports DotSpatial.Data
Imports DotSpatial.Controls.Extensions
Imports DotSpatial.Controls.Header

Namespace WindowsApplication7

    ''' <summary>
    ''' Used to display status information.
    ''' </summary>
    <InheritedExport> _
    Public Interface IStatusControl
        Inherits IProgressHandler
        ''' <summary>
        ''' Adds the specified panel.
        ''' </summary>
        ''' <param name="panel">The panel.</param>
        Sub Add(panel As StatusPanel)

        ''' <summary>
        ''' Removes the specified panel.
        ''' </summary>
        ''' <param name="panel">The panel.</param>
        Sub Remove(panel As StatusPanel)
    End Interface

End Namespace
DOCK MANAGER:
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports DotSpatial.Controls.Header
Imports DotSpatial.Controls.Docking
Imports System.ComponentModel.Composition

Namespace WindowsApplication7
    <Export(GetType(IDockManager))> _
    Public Class DummyDockManager
        Implements IDockManager

        Public Sub Add(item As DockablePanel)

        End Sub

        Public Sub ResetLayout()

        End Sub

        Public Sub Remove(key As String)

        End Sub

        Public Sub SelectPanel(key As String)

        End Sub

        Public Sub HidePanel(key As String)

        End Sub

        Public Sub ShowPanel(key As String)

        End Sub

        'public interface ActivePanelChanged
        '{
        '}

        Public Event ActivePanelChanged As EventHandler(Of DockablePanelEventArgs)
        Public Event PanelClosed As EventHandler(Of DockablePanelEventArgs)
        Public Event PanelAdded As EventHandler(Of DockablePanelEventArgs)
        Public Event PanelRemoved As EventHandler(Of DockablePanelEventArgs)
        Public Event PanelHidden As EventHandler(Of DockablePanelEventArgs)



        'public void RemoveAll()
        '{

        '}

        'public void SelectRoot(string key)
        '{

        '}

        'public event EventHandler<RootItemEventArgs> RootItemSelected;
    End Class

End Namespace
IHEADER:
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports DotSpatial.Controls.Header
Imports System.ComponentModel.Composition

Namespace WindowsApplication7
    <Export(GetType(IHeaderControl))> _
    Public Class DummyHeaderControl
        Implements IHeaderControl
        Public Sub Add(item As HeaderItem)

        End Sub

        Public Sub Remove(key As String)

        End Sub

        Public Sub RemoveAll()

        End Sub

        Public Sub SelectRoot(key As String)

        End Sub

        Public Event RootItemSelected As EventHandler(Of RootItemEventArgs)
    End Class
End Namespace
Thank you and Best Regard,
GIS4SD
Oct 17, 2014 at 9:50 AM
I am also a vb user but had to keep the above code in c#.

I created the class, compiled it and referenced to it from my vb project

here is my project downloadable from wetransfer TEXT

in the bin\release you find the dummyheadercontrol.dll

unblock it if it has been blocked by wetransfer (right click on it, properties, unblock dll)

set a reference to that dll (it points to dotspatial 1.7 so it should be compatible with your project)

and in your main project load sub write the following
        Me.AppManager1.HeaderControl = New DummyHeaderControl.DummyHeaderControl
hope this works for you

Oscar
Oct 17, 2014 at 10:48 AM
Hi Oscar,
Thank you very much, It work fine.

Best regard,

GIS4SD
Oct 17, 2014 at 11:18 AM
You are welcome

beware that with next dotspatial releases (say 1.8 or so) you will need to recompile the dummyheadercontrol setting the references to the new version of dotspatial dlls, otherwise there will be a mismatch between versions and the code won't work

Ciao
Oscar
Nov 5, 2014 at 6:22 AM
Edited Nov 5, 2014 at 6:28 AM
Hi all,
I have a easy way to pass the problem by changeing some codes in Form1.designer.vb: (1) Set the Form as Shell.;. (2)Load DotSpatial Extension.;. (3)Clear all controls which generated by the extension you have loaded (if you don't want it on the form).
However, you should carefull when editing the designer.vb by your hand.

In the Form1.designer.vb, I add these codes:
Imports System.ComponentModel.Composition
Partial Class Form1
    Inherits System.form
'=======
    <Export("Shell", GetType(ContainerControl))> _
        Private Shared Shell As ContainerControl
                                                      '=======

Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
'=======
        Me.AppManager1 = New DotSpatial.Controls.AppManager()
        Shell = Me
        AppManager1.LoadExtensions()                      
        Me.Controls.Clear()
                                                      '=======
Hope this help...
Apr 22, 2015 at 2:12 PM
hi Oscarafone77,
could you make your DLL avaible because it is missing from weTransfert. thank you very much.
Apr 22, 2015 at 2:39 PM
Hi Riadh_dz

here is the link

beware it will expire in a few days I guess

Oscar
Apr 22, 2015 at 3:21 PM
Edited Apr 22, 2015 at 3:24 PM
i have used it but still displaying " A IStatusControl extension must be included...."
Apr 23, 2015 at 9:42 AM
did you place on your app load sub some code like:
 Me.AppManager1.HeaderControl = New DummyHeaderControl.DummyHeaderControl
and did you export the Shell as Gis4sd suggested?

Oscar
Apr 29, 2015 at 2:56 PM
now it works, thank you very much