Introduction
Microsoft* Visual Studio 2022 (VS 2022) Version 17.2 (including preview releases) does 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.
FIXED
These issues are fixed with the Intel Fortran compilers available in oneAPI 2022.3 (ifx 2022.2.0 and ifort v2021.7.0) and VS 2022 v17.3.6.
Issue
These updates to VS 2022 v17.2 break the Intel Fortran Integrations into Visual Studio. This applies VS 2022 Version 17.2, not older versions. IF YOU INSTALL 17.2 you will:
- NO LONGER BE ABLE TO BUILD EXISTING FORTRAN PROJECTS with IFORT or IFX
- NO LONGER BE ABLE TO CREATE NEW PROJECTS
- 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
Platforms Windows only .AND. VS 2022 only version 17.2 (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.
- 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:
- Press the Windows Start button at the bottom left.
- Type in "Command Prompt"
- Right click on Command Prompt and click "Run as administrator"
- Click Yes if the Windows 10 User Account Control prompt is displayed
- The Command Prompt should appear
- A regular Command Prompt window will fail. Here is how to open a Command Prompt window as Administrator as required by the Microsoft process:
- 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.
- Uninstall all Intel oneAPI components
- Uninstall Visual Studio 2022 version 17.2 completely
- Find and download Visual Studio 2022 version 17.1 or older. Links provided below.
- Install Visual Studio 2022 v17.1 or older. See System Requirements, Visual Studio
- Install Intel oneAPI Toolkit(s) or Intel Fortran component
- If you do not have access to prior Visual Studio versions, you may want to try our "Partial (Temporary) Workaround Patch Kit".
For help finding older VS versions
- Visual Studio Older Versions
- Visual Studio 2022 Release History | Microsoft Docs.
- Microsoft Releases Cadence