Microsoft Visual Studio 2022 Version 17.2 and Newer Fails to Integrate with the Intel Fortran Compiler

Published: 05/12/2022  

Last Updated: 06/13/2022

Introduction

Microsoft* Visual Studio 2022 (VS 2022) Version 17.2 (including preview releases)  and newer releases do not integrate with the Intel® Fortran Compilers. Version 17.2 version was released on May 10, 2022.

Microsoft changed the API for VS 2022 beginning with Version 17.2.  This API change impacts the function calls the Intel Fortran Integrations make into Visual Studio for Fortran project support. This requires an extensive re-write and testing of the Fortran Integrations into Visual Studio.  This is a non-trivial effort underway with our Integrations team.  We hope to be able to work with VS 2022 v17.2 and newer in a future release later in 2022. 

Issue

These updates to VS 2022, the 17.2 and newer updates, break the Intel Fortran Integrations into Visual Studio. This applies VS 2022 Version 17.2 and newer versions only, not older versions.  IF YOU INSTALL 17.2 or newer YOU WILL:

  1. NO LONGER BE ABLE TO BUILD EXISTING FORTRAN PROJECTS with IFORT or IFX
  2. NO LONGER BE ABLE TO CREATE NEW PROJECTS 
  3. Be unable to debug existing executables

Several workarounds are listed below.

Symptoms

  • ConsoleFortran.vfproj : error : Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.Shell.Interop.IVsUpdateSolutionEvents'
  • Project builds fail for existing and new Fortran projects.  
  • Debugger, multiple functions no longer work - breakpoints, examining variables, etc.

Affects

Intel Fortran compiler Integrations into Visual Studio 2022 version 17.2 and newer

Platforms  Windows only .AND. VS 2022 only version 17.2 and newer (not VS 2019 or older).

  • Compilers:  IFORT and IFX versions in oneAPI 2022.1.x ( ifx v2022.0.x and ifort v2021.5.0 ) and OLDER
  • Compilers:  IFORT and IFX in oneAPI 2022.2 package (ifx 2022.1.0 and ifort v2021.6.0) 
  • Any older compiler versions than those listed above running under Visual Studio 2022
  • Does not affect any compilers in VS 2019 and older  versions of Visual Studio

SOLUTIONS and  RECOMMENDATIONS

There are a few workarounds.

  1. If you have Administrator privilege, are comfortable with editing Visual Studio configuration files, and you know how to open a Command Prompt window with Administrator Privilege, you can use the Microsoft method to revert VS 2022 17.2 to “Use the legacy native solution and build services (requires restart)”.  HERE is the Microsoft description on this process.
    •  A regular Command Prompt window will fail.  Here is how to open a Command Prompt window as Administrator as required by the Microsoft process:
      1. Press the Windows Start button at the bottom left.
      2. Type in "Command Prompt"
      3. Right click on Command Prompt and click "Run as administrator"
      4. Click Yes if the Windows 10 User Account Control prompt is displayed
      5. The Command Prompt should appear
  2. You could roll back to a previous version of Visual Studio, Visual Studio 2019 or Visual Studio 2022 17.1 or 17.0.  Version 17.0.x is a Long Term Support (LTSC) version (see Cadence link below). This assumes you have an account with Microsoft allowing you access to previous versions. 
    1. Uninstall all Intel oneAPI components
    2. Uninstall Visual Studio 2022 version 17.2 completely
    3. Find and download Visual Studio 2022 version 17.1 or older.  Links provided below.
    4. Install Visual Studio 2022 v17.1 or older. See System Requirements, Visual Studio
    5. Install Intel oneAPI Toolkit(s) or Intel Fortran component
  3. If you do not have access to prior Visual Studio versions, you may want to try our "Partial (Temporary) Workaround Patch Kit". 

We are providing a temporary patch kit to assist with your immediate need to load and build Fortran projects. Understand this is not a permanent solution and not a full solution. This patch will allow Fortran projects to load and build. Be aware this does NOT make VS 2022 17.2 fully functional compared to VS 2019 Integrations. There will remain known issues with the Debugger such as viewing variables, Watch variables, Local vars display, hover-over display of variables.  We will restore VS 2022 functionality in future releases.  We still recommend rolling back to a prior version of Visual Studio.

This patch kit is provided on the Intel Registration Center (IRC) for customers with that access. It is attached to the Intel(R) oneAPI HPC Toolkit for Windows*, and the Intel(R) Fortran Compiler & Intel(R) Fortran Compiler Classic for Windows*. Look for the download as the 3rd file in your downloads list.

The patch kit is also available on the Intel Fortran Forum

For help finding older VS versions

 

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.