Home > Plug-in Development > How to create a new CodeRush (DXCore) plug-in

How to create a new CodeRush (DXCore) plug-in

August 16th, 2010

Note, this article has been moved to the official DevExpress Support Center site. Please refer to the moved article as it might have further updates or additional comments. Thank you.

There are two ways to create a new CodeRush (DXCore) plug-in in Visual Studio:

1. Inside the IDE, from the DevExpress menu, access the “New Plug-in…” menu item:

Create New CodeRush/DXCore plug-in

2. Create a new project of type DXCore (using File –> New Project menu item):

Create New CodeRush/DXCore plug-in

In the next dialog, choose your preferred language (Visual C# or Visual Basic) and select the DXCore category to see available project templates for CodeRush plug-ins:

Create New CodeRush/DXCore plug-in

It is recommended to choose the “New Plug-in…” menu item, because in this case you can tweak additional settings for your new plug-in. The following dialog appears once you click it:

Create New CodeRush/DXCore plug-in

Choose your language of preference as well as the plug-in type, type in the plug-in name and its location if required. Click OK – the DXCore Plug-in Project Settings dialog will appear:

Create New CodeRush/DXCore plug-in

Here you can select a different title and change advanced plug-in settings, or just click OK to accept the default settings.

Available settings:

  • System Plug-In – сheck it if you’d like your plug-in to be loaded before all other plug-ins do. Simple plug-in doesn’t need this option in most of the time. System plug-ins are built to the “IDETools\System\DXCore\Bin\System\” folder and usual plug-in will be built to the “IDETools\System\DXCore\Bin\PlugIns\” folder.
  • Load Manually – check it if you want to not load the plug-in automatically when DXCore loads in Visual Studio, this option is only relevant to the development phase. For example, suppose that whilst developing your plugin, you are suddenly required to do something else. But because DXCore loads your plug-in into memory on its startup automatically, the plugin’s assembly is locked, so, you won’t be able to recompile your plug-in whilst your Visual Studio is not closed. In order to avoid this scenario, change the Load Manually” option to ensure that the DXCore never automatically loads your plugin. After that, you’re able to load plugin using the PlugIn Manager (DevExpress -> Options -> Core -> PlugIn Manager). With the PlugIn Manager you have only load your plugin into the address space of a single instance of Visual Studio. This means that when you shut down this single copy of Visual Studio, you’ll be able to continue development of your plugin.
  • Default Load Type – different types of loading your plug-in:
    • On Demand – plug-in is loaded when some process or action, for which the plugin should work, takes place, e.g. if your plugin listens to one of the events – then it will be loaded only when this event is being fired. Or, another example, if your plug-in contains an options page, the plugin will be loaded when the Options Dialog is going to display this page.
    • On Idle – plug-in will be loaded when Visual Studio editor is being idle (no user operations/interaction with IDE).
    • At Start-up – plugin will be loaded on DXCore start-up, which will add time to overall loading time.

The best option here is the default one – “On Demand”. Most of the built-in DXCore plug-ins use this load type option.

Click OK to accept your settings; the plug-in designer surface will be opened in Visual Studio:

Create New CodeRush/DXCore plug-in

The new plug-in does not provide any functionality yet. You can drop any DXCore component on its surface and subscribe to required events including those coming from Visual Studio to extend the Visual Studio IDE.

Products: DXCore
Versions: all
VS IDEs: any
Updated: Jul/30/2012
ID: D005

Similar Posts:

  1. Le
    March 25th, 2011 at 01:22 | #1

    I have this in my AssemblyInfo file:

    [assembly: DXCoreAssembly(DXCoreAssemblyType.PlugIn, “MyNameSpace”, PlugInLoadType.StartUp, LoadAbilityType.LoadEnabled)]

    However when dubugging my plug-in it doesn’t load automatically and I have to manually load it via the Plug-in Manager. Is there anyway I can get my plug-in load automatically when going into debugging it?

  2. Le
    March 25th, 2011 at 01:44 | #2

    Ok, you actually have to uncheck “Suppress Loading” and “Always Disabled” in the DXCore>Plug-in Manager in the actual VS instance that is being debugged, properly shut this instance down (File > Exit) and then stop the debugger and restart debugging and then your plug-in will load auto-start.

  3. March 25th, 2011 at 04:54 | #3

    @ Le
    Thanks for joining in and for sharing your findings!