Every organization that develops software relies on development tools. One of the great benefits of Microsoft Dynamics CRM is that you use the same tools to develop solutions with Microsoft Dynamics CRM that you use when developing solutions for any Microsoft technology. Therefore, none of the tools discussed in this section is unique to working with Microsoft Dynamics CRM.
This section examines some of the common software development tools you should have in place when working with Microsoft Dynamics CRM, including:
Integrated development environment (IDE)
Source control
Continuous integration
Installer
Additional development utilities
Microsoft Visual Studio is most likely to be your primary integrated development environment (IDE). The examples in this book use Visual Studio 2008. Because Microsoft built Microsoft Dynamics CRM on the .NET architecture, you may use any .NET client tool for your development experience (including Notepad)! However, most developers working with Microsoft Dynamics CRM choose Visual Studio as their development tool.
Source control defines the means of keeping track of changes and versions to all software files during a project. Numerous tools exist to perform this function and typically a source control system already exists within your environment, including Microsoft Visual Studio Team System, Microsoft Visual SourceSafe, CVS, ClearCase, Vault, and so on.
If you don’t have a version control tool in place or you are investigating an alternative, we recommend a free, open-source tool call Subversion (SVN). SVN provides the core file control logic and integrates to most systems. Additional tools talk to SVN for actual file access; the most popular is Tortoise, as shown in Figure 2-4.
Learn more about SVN version control system and the TortoiseSVN browser at: http://subversion.tigris.org and http://tortoisesvn.tigris.org.
Often as you bring up your development environment, setting up a continuous integration environment tends to get overlooked. However, a continuous integration system, especially automated builds, provides the following benefits:
Ensures a more robust application during development by finding build defects quickly
Simplifies deployments by ensuring a consistent set of files and steps
Can include additional post-build steps and processes
Labels source code at each build version, allowing you to branch and fix issues easily
Can be used to export and store customizations as a backup file
Can provide additional automated testing
SourceForge.NET provides an excellent free tool called CruiseControl.NET to manage automated builds for your code. You can use CruiseControl.NET in conjunction with MSBuild from Visual Studio or a free tool such as NAnt from SourceForge.NET.
You may download and review more information regarding CruiseControl. NET at http://sourceforge.net/projects/ccnet and NAnt at http://nant.sourceforge.net/.
Some of your Microsoft Dynamics CRM customizations may not deploy with the Microsoft Dynamics CRM import/export customizations functionality, including:
Custom Web pages
Plug-in assemblies
Workflow assemblies
Custom reports
Data migration
When you deploy files and changes that are not encapsulated within Microsoft Dynamics CRM’s import/export customization functionality, you should consider whether you need to use an installer.
Multiple installer programs exist on the market, including one that comes with Visual Studio. Each installer program has its own set of features, functionality, and benefits. We use the NSIS system from SourceForge.NET.
NSIS provides robust Windows installers in a very easy, scriptable, and extensible framework. Using NSIS you can create common installation wizard pages that can take information from the user and use built-in or custom functions to properly deploy and provision your application.
NSIS contains a tool that allows you to compile NSI scripts into executables, as shown in Figure 2-5. Additionally, you can access numerous additional plug-ins, starter code, and help documentation to provide a solid start to your installation development.
You can also use a development tool such as Eclipse with an NSIS plug-in to author and build your installation scripts. You can learn more about EclipseNSIS at http://nsis.sourceforge.net/EclipseNSIS_-_NSIS_plugin_for_Eclipse.
Example 2-1 shows a very simple script that generates an installer that copies a simple help file to a defined location.
Example 2-1. Sample NSIS installer script
Name "NSIS Test" # Defines !define REGKEY "SOFTWARE$(^Name)" !define TRUE 1 # MUI defines !define MUI_ICON "${NSISDIR}ContribGraphicsIconsmodern-install.ico" !define MUI_FINISHPAGE_NOAUTOCLOSE # Included files !include Sections.nsh !include MUI.nsh # Installer pages !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH # Installer languages !insertmacro MUI_LANGUAGE English # Installer attributes OutFile setup.exe InstallDir "$PROGRAMFILESNSIS Test" CRCCheck on XPStyle on ShowInstDetails show # Installer sections Section "Help Sample" Main SetOutPath $INSTDIR SetOverwrite on # Copies HelpSample.htm to the path specified in the installation wizard. File "HelpSample.htm" WriteRegStr HKLM "${REGKEY}Components" "Help Sample" 1 SectionEnd # Installer functions Function .onInit InitPluginsDir FunctionEnd
Figure 2-6 displays one of the sample wizard pages for a Windows installer using the sample NSIS script in Example 2-1.
Please visit http://nsis.sourceforge.net/Main_Page for additional information regarding NSIS.
If you develop solutions with any Microsoft technology, including Microsoft Dynamics CRM, you definitely should consider having the tools listed in Table 2-4.
Table 2-4. Additional Development Utilities
Tool | Download |
---|---|
FxCop | http://msdn.microsoft.com/en-us/library/bb429476(vs.80).aspx A free code best practice analyzer. You can incorporate it into your automatic builds, and it is highly customizable. |
ILMerge | http://research.microsoft.com/~mbarnett/ILMerge.aspx A free tool to merge multiple assemblies into a single assembly. Perfect for deploying referenced assemblies with a plug-in or workflow assembly. |
.NET Reflector | http://www.aisto.com/roeder/dotnet/ An excellent tool for analyzing .NET assemblies. |
Fiddler |
A free HTTP debugging proxy tool. Fiddler is essential for tracking and parsing the HTTP traffic between Microsoft Dynamics CRM both for development and debugging purposes. |
DebugBar |
A licensed Web development tool that integrates directly within Internet Explorer. Allows you to quickly navigate the DOM of a Microsoft Dynamics CRM Web page. |
IE Dev Toolbar |
A free Web development tool with functionality similar to the DebugBar tool. |
NUnit | http://www.nunit.org/index.php A free, open-source unit-testing framework. |
RhinoMocks | http://www.ayende.com/projects/rhino-mocks.aspx Another free, open-source unit-testing framework. See Chapter 5, for an example that uses the RhinoMocks framework. |