Some advices on how to set up your development environment for Orchard Development.
Software to install
Below you can find pieces of software that you should install for the best Orchard developer experience.
- Visual Studio 2017, 2019 or later with the following plug-ins:
- Web Essentials for better client-side development tooling (specifically Web Essentials 2017 and Web Essentials 2019).
- Web Compiler to be able to easily compile client-side assets (e.g. LESS to CSS).
- TestDriven.Net or NUnit Test Adapter for running unit tests (beware with NUnit Test Adapter that you have to build the solution while Test Explorer is open to get tests discovered; then use "Group By -> Project" to see better).
- Productivity Power Tools 2017/2019 mostly for the feature of being able to clean-up unneeded using statements and for re-opening files just closed.
- Attach To All The Things for quickly attaching the debugger to an IIS (Express) and other processes or ReAttach to quickly re-attach the debugger to previous debug targets. Debug Attach Manager helps with the same thing: If you select to attach a process for a given app then it'll remember it and select the suitable process the next time automatically, even after a VS restart (especially handy for .NET Core apps with their dotnet.exe processes).
- SQL Server Compact & SQLite Toolbox for browsing an SQL CE database.
- Code Maid for various goodies, including progress indicator for builds.
- Lombiq Orchard Visual Studio Extension with various Orchard-related features.
- Visual Studio Spell Checker (VS2017 and Later) for avoiding typos in comments and other texts.
- Markdown Editor to be able to edit Markdown files with a preview window (which can also be used to easily browse Markdown-formatted documentation files locally).
- File Nesting is very handy when adding files to a project with dependencies between them (e.g. scss files with corresponding css, min.css and css.map files).
- Visual Studio IntelliCode to give you some personalized IntelliSense suggestions as well as generate an .editorconfig file based on your project's/solution's coding style.
- Web Platform Installer for installing any necessary local developer tool or SDK. Install WebMatrix for simply browsing local SQL CE databases if you don't use the SQL Server Compact & SQLite Toolbox VS extension linked above.
- Local IIS and SQL Server (as well as SQL Server Management Studio) set up as per the following article: "How-to: running Orchard locally through IIS using SQL Server"
- An up-to-date browser with developer-aiding tools:
- Fiddler for inspecting any HTTP traffic.
Make sure to always run Visual Studio as an administrator!
Visual Studio tips
- Use code snippets; try out the ones in this package too that specifically aid Orchard development.
- Use keyboard shortcuts. The most useful ones are:
- F5: start with debugging
- Ctrl+F5: start without debugging
- F6: build
- F10: run to the next line, when debugging
- F11: step into the code on the current line (e.g. if the current line is a method call this will forward you to the body of the method), when debugging
- Ctrl+F10: run to the cursor, when debugging
- Ctrl+.: opens the Smart Tag
- Ctrl+Shift+Enter: adds a new line below the current line
- F9: places a breakpoint on the current line
- Ctrl+K, Ctrl+D: format document
- Ctrl+K, Ctrl+C: comment selection
- Ctrl+K, Ctrl+U: uncomment selection
- Ctrl+,: opens the Navigate To windows (i.e. search for types or members)
- Ctrl+D, Ctrl+E or Ctrl+Alt+E: opens the Exceptions configuration page. Tick Common Language Runtime Exceptions - Thrown to see all exceptions, even if they're caught.
- Ctrl+Q to access the Quick Launch bar
- Shift+Del: delete line
- You may want to set up Ctrl+W for closing the current file for the File.Close command and Ctrl+Shift+T for Edit.UndoClose (only available if PowerCommands is installed).
- You may want to always run VS as an administrator. This will simplify debugging web apps running in IIS since you can only attach a debugger to the IIS worker process if VS is run as an administrator.
Mercurial and TortoiseHg tips
- Interact with Mercurial through the TortoiseHg Workbench. You can add a cloned repository to the Workbench by opening it from the repository folder: right click on the folder and select the Workbench.
- Use groups in the Repository Registry to group your repositories.
- See the mercurial.ini in file in this package that you can use to initialize your Mercurial instance quickly with some useful settings. You can open your mercurial.ini file quickly from inside TortoiseHg by going to File/Settings/Edit File.
- .hgignore files (drop into the repositories' folders and rename to .hgignore):
This page and many others here are part of the open source, portable package of Orchard goodies: the Orchard Dojo Library. The Library is freely accessible by anyone; just go to its repository to download its full content (you can even download the textual content of the Library as a big concatenated document in HTML), file issues or fork it! You can even edit it online on Bitbucket, just click on the Edit link in the upper right corner!