Microsoft Dynamics SL 2018 Project Template for Visual Studio 2019

UPDATE (2023-03-14): You CANNOT use the Visual Studio 2022 Windows Forms designer with the Dynamics SL 2018 CU9 SDK or prior versions at this time. The solution is to use Visual Studio 2019 or earlier versions.

The reason is that VS 2022 is a 64-bit application and the Windows Forms designer requires 64-bit controls. The Dynamics SL SDK controls are 32-bit controls. You cannot add them to the toolbox and the designer will show nothing but an error message if you open an existing project. You will not be able to use it. Here is a link to the thread of developers complaining about this and the VS Windows Forms team responding. In short, they worked hard to make the designer work with .Net Core, and in the process broke .Net Framework apps. You can scroll to the bottom to see the latest workaround suggestions. It is possible to recompile your project in VS 2022, without making any changes to the designer, but it gets annoying very quickly when you can’t make any design changes.

UPDATE: Dynamics SL 2018, CU3 (and later CUs) include an msi named “SDKSetupVS2017.msi” that is the official SDK when working with Visual Studio 2017 and 2019. This post remains helpful if you have a prior CU installed and cannot install the latest CU for some reason…

You can now download a Visual Studio 2019 project template for Microsoft Dynamics SL 2018 from the Visual Studio marketplace.

After installing Visual Studio 2019, I tried to use the method described in an earlier post to use the official project template with it. That simply didn’t work. After listening to episode 1630 of DotNetRocks, “Visual Studio Templates with Layla Porter,” I decided to create a version of the Dynamics SL 2018 Project Template for VS 2019. That worked! I checked the license for the source code included in the template, the Microsoft Public License, and concluded that it allowed me to publish the template as an extension.

In order to use this project template, you must have a Microsoft Dynamics SL 2018 client installed on your workstation. It references two DLLs that are installed with the client. I used the project template from CU1 (Cumulative Update 1) when creating this template, but it should work equally well with the GA (General Availability) release and CU2.

The target framework for the project template defaults to “.Net Framework 4 Client Profile.” If your workstations or Citrix server have a higher version of the .Net Framework installed, or you want to use more than just the Client Profile, you can change that. Do not set it lower than the .Net Framework 4.

You will need to add controls the the toolbox manually. To do that:
1) Right-click in the toolbox and select Add Tab. Name it Dynamics SL.
2) Right-click in the new tab and select “Choose items…”
3) Browse to “C:\Program Files (x86)\Common Files\Microsoft Shared\DynamicsSL”.
4) Select the Microsoft.Dynamics.SL.Controls.dll. Click Open.
5) The controls (DSLCheck, DSLCombo, DSLDate, DSLFloat, DSLGrid, DSLInteger, DSLMaskedText, DSLOption, and DSLUpdate) should automatically be checked and highlighted. Click OK.

If you have any feedback about this template, or adding the controls to the toolbox, please leave a comment below or click Contact to send an email.

Leave a Reply