Installing a Microsoft Dynamics 365 X++ Application from Within Visual Studio

By Josh Lee | March 19, 2017

Installing a microsoft dynamics 365 x++ application from within visual studio

In this blog, I will review how to install an X++ application update from within Visual Studio on a development machine running Microsoft Dynamics 365 for Operations (or D365 for short).

Overview

The D365 X++ application update process from a high level follows the process steps below. I will be discussing steps 1-5 as depicted below.

VisualStudioMicrosoftDynamics365_JoshLee1

 

Image courtesy of – https://ax.help.dynamics.com/en/wiki/configuring-and-installing-a-metadata-hotfix-package/

X++ Application Installation Methods

There are 2 methods that you can follow to install an application hotfix on a development machine:

Method 1:    Manually using the SCDPBundleInstall.exe with a bunch of command line parameters

Method 2:    Within Visual Studio using the Apply Hotfix add-in.

Method 1 is well documented here – https://ax.help.dynamics.com/en/wiki/configuring-and-installing-a-metadata-hotfix-package/, so I will be focusing on Method 2.

Method 2: Applying an X++ Application Update within Visual Studio

I’ll assume that at this point you have an existing X++ application update that you wish to apply.  I’ll be applying KB 3181574 to my development environment.

VisualStudioMicrosoftDynamics365_JoshLee2

  1. Start by downloading the hotfix onto the Development machine and saving it to D:\Temp.

VisualStudioMicrosoftDynamics365_JoshLee3

  1. Right-click on the zipped file, select Properties and then from the General tab click Unblock to unlock the files.

VisualStudioMicrosoftDynamics365_JoshLee4

VisualStudioMicrosoftDynamics365_JoshLee5

The reason you must do this is because when you download files from the internet (or LCS in our case), Internet Explorer classifies certain files as unsafe. Clicking Unblock removes this identifier information allowing .exe’s or PowerShell scripts (if any) to be able to execute.   If you don’t unblock the file you can run into situations where the file will not install correctly or successfully.

TIP: if you have already extracted the files you could delete the extracted folder, unblock the .zip file and then extract the file again.  Or you could use PowerShell and unblocked the individual files by running this command from the PowerShell command prompt (as Admin):

Get-ChildItem -File -Recurse | Unblock-File

VisualStudioMicrosoftDynamics365_JoshLee6

  1. After you have Unblocked the file, extract the file.

VisualStudioMicrosoftDynamics365_JoshLee7

  1. Open Visual Studio (as administrator) and go to Dynamics 365 | Addins | Apply Hotfix

VisualStudioMicrosoftDynamics365_JoshLee8

  1. The Apply Hotfix window will appear and it should be pre-populated with the correct information as shown below. In the screenshot the Source control project Uri has been removed for obvious reasons. If the information is not populated, then there is a TFS configuration issue you will need to address.  TFS should already be configured with your TFS integration information. Click Browse and navigate to the location you extracted the files to in Step 3 above.

VisualStudioMicrosoftDynamics365_JoshLee9

  1. Click Prepare. This will create a changeset of all the existing files in your environment that will be modified by the hotfix package. The prepare command does not install the hotfix(s).

You really want to do this.  Should the hotfix be something you don’t want, this check-in is how you recover.

VisualStudioMicrosoftDynamics365_JoshLee10

  1. After you click Prepare, the Apply Hotfix window will appear like it is hung or nothing is happening. It would be nice if there was an install feedback mechanism, however, you can see that progress is occurring as you’ll see files starting to list in the Team Explorer view (arrow pointing to new files being added).  These are the files that will be modified, so they are added in the Prepare check-in to allow the ability to revert back to pre-modification changes.

VisualStudioMicrosoftDynamics365_JoshLee11

  1. Once you can move the Apply Hotfix window around, (I know, this sounds hokey), this is the indication the Prepare command has finished. Check-in the pending changes to create a backup of these files in VSTS. Again, this will enable rolling back the hotfix if needed.  You will need to close the Apply Hotfix window to complete this operation.

VisualStudioMicrosoftDynamics365_JoshLee12

  1. Re-open the Apply Hotfix window and re-select the hotfix. Then click Apply.

VisualStudioMicrosoftDynamics365_JoshLee13

10. Once the hotfix is successfully installed you will receive a success window.

VisualStudioMicrosoftDynamics365_JoshLee14

11. At this point you will need to check if there are any conflicts (not shown) and resolve any issues by going to Dynamics AX > Addins > Create project from conflicts

12. Now build the model(s) affected by hotfix to validate there are no errors on the Dev box. In my build, I always check the option Build Reference Packages for completeness.

VisualStudioMicrosoftDynamics365_JoshLee15

13. Once the build is successful (no errors) test your changes to ensure that the fix corrected the issue.

14. After successful testing, check-in the final changes into TFS.

VisualStudioMicrosoftDynamics365_JoshLee16

15. Kick off a build on the build server to validate there aren’t any dependencies on the Dev machine not on the Build machine. This is a great sanity check to help ensure successful builds.  The build process upon completion produces a deployable package that can be moved to other environments such as UAT.

VisualStudioMicrosoftDynamics365_JoshLee17

After a successful build, download the packages artifact that contains the code.

VisualStudioMicrosoftDynamics365_JoshLee18

Related Posts

Recommended Reading:

Managing Your Business Through Uncertain Times Using Dynamics 365 Finance and Operations

  Dynamics 365 Finance and Operations (F&O) can help you make informed decisions on how to move your business forward. […]

Read the Article
5.13.22 Power Platform

Using Power BI Object Level Security

  The following article will demonstrate how to use Power BI Object Level Security to disable column data based on […]

Read the Article
5.12.22 Dynamics CRM

How to Use the Stoneridge Support Portal

Stoneridge Software’s support portal is an intuitive and useful function that makes it easy for you to access resources to […]

Read the Article
5.6.22 Dynamics GP

Dynamics GP Transaction Removal: Purchase Orders

  Are you having performance issues with Purchase Orders?  Do you find that there are old Purchase Orders on your […]

Read the Article
5.5.22 Dynamics GP

The Real Story about the Long-Term Future of Dynamics GP Support

I’ve seen a number of people put forward comment that Dynamics GP is going away and you have to get […]

Read the Article

New Features in Dynamics 365 Business Central 2022 Wave 1 Release – Financial Enhancements

The Dynamics 365 Businses Central 2022 Wave 1 Release has a lot of new and exciting features to help your […]

Read the Article
4.29.22 Dynamics GP

Dynamics GP Transaction Removals: Bank Reconciliation

  This is part 2 of a 3 part series on Dynamics GP Transaction Removals. These quick tips will hopefully […]

Read the Article
4.28.22 Dynamics GP

Uncommonly Used Features – Integrate Purchasing and Payables to Fixed Assets in Dynamics GP

Being able to integrate Purchasing and Payables to Fixed Assets in Dynamics GP will help you create visibility for your […]

Read the Article

New Features in the Dynamics 365 Business Central 2022 Wave 1 Release – Ease-of-Use Features

  There are many new features in the Dynamics 365 Business Central 2022 Wave 1 Release to get excited about! […]

Read the Article

Start the Conversation

It’s our mission to help clients win. We’d love to talk to you about the right business solutions to help you achieve your goals.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!

X