简体   繁体   中英

How to solve the problem of loading Fortran projects in Microsoft Visual Studio 2022?

After installing the version 17.2, I can no longer load my Fortran projects into Microsoft Visual studio. When I open the.sln file, I get the two following errors.

在此处输入图像描述

在此处输入图像描述

It seems that the problem is due to the inability to load the package: 'CompatibilityToolPackage' correctly.

My ActivityLog.xml file

I found this message from Intel about the problem:

https://community.intel.com/t5/Intel-Fortran-Compiler/Do-not-upgrade-VS-2022-to-version-v17-2-It-breaks-all/mp/1382358

Basically, Visual Studio 17.2 does not work with Intel Fortran. There is no workaround. You have to back install to a previous version of Visual Studio. The document gives instructions on how, and I have copied and pasted them here:

  1. Uninstall all Intel oneAPI components
  2. Uninstall Visual Studio 2022 v17.2 completely
  3. Find and download Visual Studio 2022 v17.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

The following steps work for newest versions of Visual Studio and Intel oneAPI as of now (Jan 16 2023).

Uninstall:

  • All oneAPI packages (HPC, Base)
  • Visual Studio

Install (64-bit):

  • Visual Studio Community 2022 (v17.4.4)
  • Intel oneAPI Base Toolkit (v2023.0.0)
  • Intel oneAPI HPC Toolkit (v2023.0.0)

Install (32-bit):

To open old Fortran solutions (especially when it is cloned or copied to a new PC):

  • Open the folder (folder A) that contain the solution file (.sln)
  • In the File Explorer, open View/Options/View/Show hidden files, folders, or drives
  • Delete the hidden.vs folder within folder A
  • Run the solution file, and it works now!

If not, VS will show that the Fortran project is incompatible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM