Compile and Debug Mixed-mode Projects

You must use Microsoft Visual Studio 2015 Update 3 to compile ObjectARX applications for use in AutoCAD 2018. It is possible to support programs in earlier releases with the appropriate compilers installed. The following mentions the development environments needed to compile programs for earlier releases of the AutoCAD product:

In many cases, it is possible to maintain a single project and target a multiple compilers using a single development environment.

AutoCAD 2017 and 2018 both target the .NET Framework 4.6, which is the default target for new projects in Microsoft Visual Studio 2015. No additional steps are required to test or debug an application in AutoCAD 2017 and 2018.

To use Microsoft Visual Studio 2015 to build and debug projects in AutoCAD 2015 or AutoCAD 2016, you need to change the target .NET Framework and Platform Toolset for your projects. Targeting a different .NET Framework with Microsoft Visual Studio 2015 requires you to install:

The following explains how to change the target .NET Framework and Platform Toolset for a Microsoft Visual Studio 2015 project to compile a project for use with AutoCAD 2015 and 2016:

  1. Migrate your Microsoft Visual Studio 2012 project or create a new project in Microsoft Visual Studio 2015.
  2. In Microsoft Visual Studio, click Project menu Properties.
  3. In the Property Pages dialog box, Configuration drop-down list, choose a configuration to edit.
  4. In the Properties tree, on the left, expand Configuration Properties and select General.
  5. In the Properties pane, on the right, under the General category select Platform Toolset and choose v110. Click OK.
  6. Next, close the solution/project in Microsoft Visual Studio. Click File menu Close Solution.
  7. In Windows Explorer, browse to the location of your project.
  8. Locate the file with the extension .vcsproj.

    For example, the file would be named AdskCustomPalette.vcsproj if the project name was AdskCustomPalette. The project name might not be the same as the solution.

  9. Right-click the file with the extension .vcsproj. Click Open with Notepad.

    If needed, hold Shift and then right-click. Click Open With and then Choose Program. In the Open With dialog box, select Notepad and click OK.

  10. Locate the ‘PropertyGroup’ element.
  11. Change the value of v4.6 for the TargetFrameworkVersion attribute to v4.5. The attribute should now look like <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>.
    Note: If you need to use .NET Framework 3.5 Client or .NET Framework 4.0 Client, add <TargetFrameworkProfile>Client</TargetFrameworkProfile> to the ‘PropertyGroup’ element.
  12. In Notepad, click File menu > Save. Close Notepad.
  13. Reopen the project in Microsoft Visual Studio.
  14. Build/debug the project as you would with Microsoft Visual Studio.
Note: You should not have to change the TargetFrameworkVersion attribute back to v4.5 when you want to debug an application in AutoCAD 2015 or AutoCAD 2016 from Microsoft Visual Studio 2015. For AutoCAD 2017, you have to use Microsoft Visual Studio 2015 and .NET version should be 4.6.

Additional information on multi-target projects can be found at the following URLs: