Friday, June 3, 2016

Creating a new Orchard Module

If you want to create a new Orchard module, you might go through all the trouble of mimicking or copying an existing Orchard module in Visual Studio, but it is much, much easier to simply create a new Orchard module using the Orchard command line!

To get started, you can open an Administrative command prompt at the location of the Orchard.Web bin directory and run orchard.exe:


In order to be able to generate a new Orchard module, you will first have to enable the Code Generation feature as follows:


Next, you will want to actually create your module using the following command:


However, you might encounter the following error message:


Therefore, in order to resolve this issue, you will want to change the flag /IncludeInSolution:true to /IncludeInSolution:false:


Next, you will want to manually add the project to the Visual Studio solution in the Modules directory.

Once it has been added to the Visual Studio solution, you can update OrchardVersion in the Module.txt file to match your current version of Orchard such as this:

OrchardVersion: 1.9

Once you have that in place, you are ready to work with your new Module in Orchard!

No comments:

Post a Comment