Introducing a new productivity Visual Studio extension for CRM developers

I have released a new Visual Studio extension that aims to quicken the dev/debug cycles for CRM developers.

1 Menu

This extension allows you to quickly deploy web resources and assembly changes to CRM, and also to attach the debugger to the Async Service, IIS or the Sandbox Worker process using keyboard shortcuts.

Regarding assembly deployment, the intention is to only deploy binary changes. The tool therefore does not deal with assembly or plugin step registration in CRM. To use the deploy assembly commands, you would need to first register the assembly with CRM using other tools (e.g. the Plugin Registration tool).

Below is a description of the actions performed by each of the command.

Note that most of the commands below require you to run Visual Studio under an account with local administrator permissions.

Deploy Assemblies to Bin Folder (Alt + D, B)

  • Builds the solution’s StartUp project
  • Recycles the CRM app pool and restarts the Async Service to release locked files
  • Copies the StartUp project output files to the CRM’s bin folder on the local machine

Deploy Assembly to CRM Database (Alt + D, D)

  • Builds the solution’s StartUp project
  • Connects to CRM (using configured connection string) and upload the project’s main output file to the CRM database
  • Copy the debug file (i.e. the .PDB file) of the project’s main output to CRM’s bin folder on the local machine

This command connects to CRM using a connection string. This is set by a property at the solution level in the Solution Explorer.​

Setting

This command only deploys the project’s main output, i.e. single assembly. All other files are ignored.

Deploy Assemblies to GAC (Alt + D, G)

  • Builds the solution’s StartUp project
  • Install all DLLs found in the project’s output folder to the local computer’s GAC
  • Recycles the CRM app pool and restarts the Async Service to ensure the new binaries are picked up

Deploy Web Resources (Alt + D, W)

  • Saves and deploys files under the WebResources folder of the StartUp project as web resources
  • Publishes the web resources

This command looks for files under a folder named WebResources and connect to CRM (using the specified connection string) to upload them as web resources. The name of the web resource in CRM is determined by the folder structure of the file within the project. Below are some examples of how the CRM name will be determined.

  • If the file is located at WebResources\new_script.js – the CRM name will be new_script.js
  • If the file is located at WebResources\bnh_scripts\account.js – the CRM name will be bnh_scripts/account.js.

Note that CRM requires the name to have a prefix so ensure that you include this in the folder names (for nested files) or file names (for files directly under the WebResources folder).

The web resource type is determined base on the file extension. Files with unrecognised extensions are ignored.

Web resources are created if they do not already exist in CRM, otherwise they are updated.

Attach to Async Service (Alt + A, A)

  • Attach the debugger to the Async Service on the local machine

Attach to IIS (Alt + A, I)

  • Attach the debugger to the CRM app pool on the local machine

Attach to Sandbox Worker Process (Alt + A, S)

  • Attach the debugger to the Sandbox Worker Process on the local machine

Please note that to debug Sandbox plugins, you will need to make a change in the Registry to disable the shutdown of the Sandbox Worker process as detailed here: https://msdn.microsoft.com/en-us/library/gg328574.aspx#bkmk_sandboxplugin.

Limitations

This extension works best when you are developing against a local CRM server. The following commands will not work, or partially work, if you are not developing against a local CRM server:

  • Deploy Assemblies to Bin Folder
  • Deploy Assemblies to GAC
  • Deploy Assembly to CRM Database – the assembly will be updated in the CRM database, but the debug file will not be copied to the CRM’s Bin folder.
  • Attach to Async Service
  • Attach to IIS

Download

You can download the extension from Visual Studio Gallery using this link.

About Bernado

Based in Australia, I am a freelance SharePoint and Dynamics CRM developer. I love developing innovative solutions that address business and everyday problems. Feel free to contact me if you think I can help you with your SharePoint or CRM implementation.
This entry was posted in CRM. Bookmark the permalink.

7 Responses to Introducing a new productivity Visual Studio extension for CRM developers

  1. Jacob says:

    Hi Bernado,
    This is a great tool, thanks a lot for writing it, However, except for webpages, its not working after the latest upgrade (3.8). Below is the error, any help on this much appreciated.

    Last error from CRM: ************ FaultException`1 – RetrieveMultiple : RetrieveMultiple to CRM via IOrganizationService |=> ‘adx_entityform’ entity doesn’t contain attribute with Name = ‘adx_websiteid’.
    ‘adx_entityform’ entity doesn’t contain attribute with Name = ‘adx_websiteid’. => ‘adx_entityform’ entity doesn’t contain attribute with Name = ‘adx_websiteid’.[TerminalFailure] Failed to Execute Command – RetrieveMultiple : RequestID=9f60ec12-aed8-41e4-a02b-56cf4d3a2f5c : RetrieveMultiple to CRM via IOrganizationService duration=00:00:00.1216353 ExceptionMessage = ‘adx_entityform’ entity doesn’t contain attribute with Name = ‘adx_websiteid’.

    • Bernado says:

      Hi Jacob, are you using onprem Portal version 7?

    • Bernado says:

      Hey Jacob, support for onprem Portal version 7 was dropped in version 3.8. This may be what’s causing the issue you described.

      I have now added that support back and published a new version (3.8.1). Please update the extension the see how that goes.

      • Jacob says:

        I just realized I did not thank you for restoring support for onprem Portal version 7. Its better late (2 years) than never. 🙂 Thank you. This tool is a life saver.

      • Bernado says:

        Really appreciate the feedback – and I’m glad you find the tool useful :).

  2. Jeremy says:

    Is there a way to download older versions of CRMQuickDeploy?

Leave a comment