Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28383 Discussions

VS 2022 v17.2.x breaks Intel Fortran, use v17.3.2 and newer

Ron_Green
Moderator
19,047 Views

Update 9 August 2022:

  The information, errors, workarounds are for older VS 2022 v17.2.x.  As of 9 August 2022 Visual Studio 2022 v17.3 was released which fixes this issue.

UPGRADE VS2022 to v17.3.0 or newer

 

OLDER 17.2.X INFORMATION

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 v17.2.x

Platforms:  Windows only .AND. VS 2022 v17.2.x only (not VS2019 or older).

  • Compilers:  IFORT and IFX versions in
    oneAPI 2022.2 ( ifx v2022.1.0 and ifort v2021.6.0 ) and OLDER
  • Any older Intel Fortran versions than those listed above running under Visual Studio 2022.
  • Does not affect any compilers in VS2019 and older Visual Studios

 

DETAILS:

Microsoft* Visual Studio 2022 (VS 2022) Version 17.2.x  do not work with our Intel Fortran Integrations into Visual Studio in oneAPI 2022.2 and older packages.  This VS version was released on May 10, 2022.  All newer versions of 17.2.x also impacted.  VS 2022 17.3.0 and newer fixes the issue.

Issue:  This update to VS 2022, the 17.2.x , breaks the Intel Fortran Integrations into Visual Studio.  VS 2022 only, not older versions.  IF YOU INSTALL 17.2 and you use packages from oneAPI 2022.2 or older YOU WILL:

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

 

Upgrade your VS 2022 to 17.3.0 or greater

 

57 Replies
johniou
Novice
13,636 Views

From the Microsoft VS forums, there is a quick workaround that worked for me.

> https://developercommunity.visualstudio.com/t/Cant-open-existing-fortran-projects-Ca/10051432#T-N10052680

> This should allow you to manually turn on the “Use the legacy native solution and build services (requires restart)” option:

1. Ensure that all instances of Visual Studio are closed
2. Open “C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Platform\Shell\Microsoft.VisualStudio.FeatureFlags.pkgdef” in a text editor
3. Look for an entry in the file matching “[$RootKey$\FeatureFlags\Solution\Services\UseLegacy]”
4. Modify the value line that is under “[$RootKey$\FeatureFlags\Solution\Services\UseLegacy]” so that it is: “Value”=dword:00000001 and save the file
5. Open an administrator command prompt and navigate to “C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE”
6. Run “devenv /updateconfiguration”

 

FortranFan
Honored Contributor II
13,583 Views

@johniou , thanks very much for your post.

 

Dear Intel team, it will be very useful if the VS integration team members can test out the workaround indicated by @johniou and report here if it can be used more widely.  Also, Intel might find it really useful to have a member or two post at that MSDN thread mentioned in the above workaround and connect with the MSDN rep on that thread, it might open up connections that can prove useful in later situations.

0 Kudos
Ron_Green
Moderator
13,560 Views

Thanks, I will add this to my write up.

BTW, we are not the only vendor affected by this change in the VS COM API. 

0 Kudos
johniou
Novice
12,809 Views

This might be unrelated, but after this fix, the "Save All" functionality no longer works within VS2022, regardless of project type or even language. I tested with Fortran Fixed Form, Fortran Free From, and C#.

 

Both using the key `Ctrl-Shift-S`, the button on the toolbar, or the `Save All` menu item under `File`.

 

Definitely worth testing more.  In the meantime, I will use VS2017.

0 Kudos
Daniel_Dopico
New Contributor I
13,618 Views

It would be very nice to get a warning when trying to install the oneAPI compiler on a Visual Studio version not tested by intel. It took me more than 1 day to guess what the problem was.

0 Kudos
Ron_Green
Moderator
13,561 Views

This was a "minor" update for VS 2022, going from 17.1 to 17.2

Microsoft release these update every 2-3 months.

Most of them do not break our integrations.

We can only claim support for officially released versions of VS.  We of course test against the early Previews but it is not uncommon for changes between last Preview and their official releases.  Thus we cannot validate our compiler until an official release is in house.

In the past, we would refuse to install on VS versions that were not validated with our software.  This drew an enormous amount of complaints, as often the target worked perfectly fine with our software.  With the rapid updates to VS this is impossible today.

A warning - similar to above: users fret and worry if they get an "unsupported" warning.  A surprising number of users do not know the difference between a warning and an error message.

 

In all cases, the Release Notes for our compiler should be read, in particular the Supported Software section.

 

We will consider your recommendation: a warning perhaps.  But since our Updates and their Updates are not in synch, all users installing on Community Edition, which is only their latest, would in the majority of cases get an "Unsupported" message.  Not a friendly introduction to our compiler. 

 

Believe me, we are as frustrated as you with this situation, and trying once again to get more advanced roadmaps and notices from Microsoft on their VS plans.  And looking at alternatives such as VS Code.  

Daniel_Dopico
New Contributor I
13,444 Views

I agree and I understand most of your comments. I didn't go to the Release Notes in a first term because I had the same version of oneAPI with Visual Studio 17.1.5 working on a different machine and I wrongly assumed that they could not substantially change the VS in a minor update. This fact made more difficult for me guessing what it happened.

0 Kudos
JohnNichols
Valued Contributor III
13,345 Views

It is never a good idea to use the latest VS releases, unless you are willing to back track and put up with pain.  MS is being much more aggressive about changes, you see this in the C# changes that can be a real problem with breaking old stuff.  

 

It is a good idea to have two VS going so if one breaks you can at least keep working while the mess is sorted.  

dennis_timlinars_usd
12,708 Views

Version 17.2.3 just came out - does anyone know if FORTRAN integration is still a problem?

0 Kudos
johniou
Novice
12,206 Views

As of v17.2.4 of VS 2022, the integration is still not functioning.

0 Kudos
Ron_Green
Moderator
12,021 Views

Yes,  with 17.2 and newer Microsoft made some changes to the COM API interfaces.  Those are for improved security.  The new interfaces will be in all VS 2022 versions going forward from 17.2.0 into all future versions.   What is needed is either our temporary patch kit OR you can wait for our next oneAPI Fortran Update release sometime in the coming months.

0 Kudos
Ron_Green
Moderator
12,694 Views

There are a couple of responses possible here, depending on what your system has installed.

 

IF you have already used the workaround in this post or the temporary patch provided on a 17.2.2 or .1 version of VS, and you are simply installing this new update to Visual Studio 2022 that is one scenario.  This is under test today.  I would not expect any issues with the .3 update to VS but .... anything is possible.  At this time 17.2.3 has not completed our internal testing.

 

If you have VS 2022 17.2.3 installed and want to install Intel Fortran for the first time on this VS from the oneAPI 2022 Update 1 packages, then VS 2022 will not work, just like all 17.2.x versions.  You will need, after the Intel Fortran installation, do the workaround from MS or install our Integrations fix.

0 Kudos
JohnNichols
Valued Contributor III
12,651 Views

Stick with VS 2019 for the moment - there are no significant differences worth the pain.  

Did I say that.  

0 Kudos
andrew_4619
Honored Contributor II
12,483 Views

For many years I have being saying stick to VS N  where N is not the latest until such a time as it is no longer supported by the latest Fortran. This is by far the least painful approach. If you are primarily a Fortran only user you will not miss out on anything other than hassle....

0 Kudos
FortranFan
Honored Contributor II
12,435 Views

@Ron_Green and all Intel Support Members following this forum:

Fyi, a strong case to upgrade to Visual Studio 2022 v17.2+ is developing among some teams I know in the industry, the justification being;

1. 64-bit version of Visual Studio which is seen as crucial toward stable and performant user experience with VS IDE, especially on very large VS solutions; generally these solutions are "large" with many C# / VB.NET projects and managed C++ and unmanaged C/C++, etc. libraries mixed in;

2. Upgrades and enhancements to the .NET platform that help with cross-platform and cloud development

Now these teams have a few Fortran DLL projects based on Intel Fortran.

Thus these Fortran projects currently are seen as bottlenecks toward the upgrade path to VS 2022 due to the integration issues with oneAPI Fortran compiler setup and VS.

Note this situation can come to a head later this summer, before Fall for sure.  Anything Intel Software team can do to resolve this by then will be very helpful toward the retention of the above-mentioned projects in Fortran.  Thanks,

 

Ron_Green
Moderator
12,063 Views

We completely understand the situation.  Our next oneAPI Update will have fixes for VS 2022.  And of course we will support older versions of VS 2022 17.1.x and older according to our System Requirements specifications. 

0 Kudos
JEduCB
Employee
11,859 Views

Hi @Ron_Green ,

Is there any estimation about when the next oneAPI update will be released?

Thanks

0 Kudos
Ron_Green
Moderator
11,778 Views

Next Update:  We do not give out dates, as we  sometimes have to slip for last minute edits or security patches.  What I can say is unless you can wait several months you'd be better off using the MS workaround or the patch kit for now.   There is currently no Update planned anytime soon.

stedwomas
Beginner
11,558 Views

I mistakenly downloaded  Visual  Studio 17.2 and it messes up my fortran. I uninstalled  Visual  Studio 17.2. WHERE do I obtain  link to download Visual Studio 2022 v17.1. I can only see links to Visual Studio 2022 v17.2. and before that Visual Studio 2019.  

 

Visual Studio 2022 v17.1 had faults with not updating watch windows in fortran, but now i am completely stuffed  Visual Studio 2022 v17.2 has even worse fortran issues

 

steve K

0 Kudos
stedwomas
Beginner
11,554 Views

I reloaded Visual  Studio 17.2 and the patch - the fortran folders loaded . Clean solution worked , BUT when i tried a build - Visual Studio ,17.2 crashed out !!!!???

0 Kudos
Reply