Getting Started - rezanid/xrmtools GitHub Wiki
Xrm Tools is very easy to setup. You will be able to install and set it up in about a minute.
In Visual Studio, open the Extensions > Manage Extensions menu. Search for “Xrm Tools” and install the extension (you may need to restart Visual Studio after installation).
-
Open Tools -> Options.... and scroll down to find Xrm Tools in the list of options. This is where you can configure the extension.
-
Select the Environments in the list. Click the “…” button to add a new environment. Provide a Connection String which can simply be your environment URL and give it a name.
Note
In most cases, you can just enter the environment’s URL (e.g. https://test-environment.crm.dynamics.com) as the connection string and give it a friendly name. When needed, Xrm Tools will ask you to authenticate and caches your authentication token using Microsoft's official and latest MSAL library securely on your machine. (Read more about Connection Strings).
-
Choose scope for Current Environment: Decide how Xrm Tools should store the URL of your “Current Environment”. By default, current environment is stored in your Visual Studio settings, but you can also store it at the solution or project level:
- Global (Visual Studio options) – The environment selection is kept per user on that machine. This is not shared with others.
- Solution (.sln) file – The environment URL is saved in the solution, which can be checked into source control so the team uses the same environment.
- Project (.csproj) file – The environment URL is saved in a specific project file (useful if each project targets a different environment).
- Solution User Options (.suo) file – The selection is private to you (not shared, used for personal overrides).
Choose the option that fits your workflow. For example, small teams can store the environment URL in the solution or the project so everyone can work in the same development environment. Set the Current Environment option accordingly in the Xrm Tools settings, then click OK to close the Options dialog.
Note
If you chose to keep the environment in the solution or project, only the environment’s URL is stored in those files (not any credentials).
-
Set environment in Solution/Project (if applicable): If you configured the Current Environment to be stored in the solution or project, you need to initialize that setting in the context of the solution/project. Right-click on the solution (or project) in Solution Explorer and select Set environment… from the context menu.
This will write the environment’s URL into the .sln or .csproj file. Other developers who open the solution (or other projects in the solution) will be able to use that same environment from Visual Studio.
- In your plugin project, add the NuGet package XrmTools.Meta.Attributes. This is a source-only package that contains the custom attributes (like [Plugin], [Step], etc.) used by Xrm Tools. Because it’s a source-only (development) package, it won’t add any assembly references to your project, but it will make the attributes available in your code.
At this point, Xrm Tools is installed and configured with your environment. The extension will remember the Current Environment you set. Next, you can start creating plugins or custom APIs within this Visual Studio solution.