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

nuget restore fails for all vfproj-files in command prompt

rwg
Beginner
1,101 Views

I'm using Visual Studio 17.6.5 and Intel® Fortran Compiler Classic for applications running on IA-32, version 2021.7.0 Package ID: w_oneAPI_2022.2.0.9553 an nuget.exe Version 6.6.1.2

I have a mixed language project and use some nuget-packages in the c# projects.
This solution can be compiled and linked without any problem inside from Visual Studio.
Now I want do link and compile this solution outside from Visual Studio.
My first step is to restore the nuget packages so I tried "nuget restore solution.sln" in the "Intel oneAPI command prompt for Intel64 for Visual Studio 2022" but this gives me always error MSB4075 for all my vfproj-files.
MSB4075 says that I have to open the project in Visual Studio and convert it to the newest version.
I added a new Fortran Project to my solution but this new project also gives me error MSB4075.
What can I do to restore my nuget packages outside from Visual Studio?

 

0 Kudos
6 Replies
rwg
Beginner
1,058 Views

I made a support request for this issue (request number is 05952038).

0 Kudos
rwg
Beginner
1,058 Views

I made a support request for this issue. Request number is 05952038.

0 Kudos
IanH
Honored Contributor II
1,042 Views

I suspect nuget only supports Visual Studio projects that MSBuild understands.  MSBuild doesn't know what to do with Intel Fortran Visual Studio projects..

0 Kudos
rwg
Beginner
974 Views

Thanks for your reply!

That can be right. So I have to find out how Visual Studio updates the nuget packages because linking (and updating nuget packages) inside Visual Studio is no problem. But I don't know how to find out how Visual Studio updates the nuget packages ("dotnet restore" gives the same error messages).

And this does not explain why this worked with an older version of Visual Studio and Intel Fortran (and MSBuild).

I even use "devenv.com solution.sln /build Configuration" to build my project. But this does not restore the nuget packages. So in the past I added nuget /restore before and this does not work anymore.

0 Kudos
Ron_Green
Moderator
901 Views

Our engineering team had this to say:

 NuGet.exe does not work with Fortran projects (.vfproj is incompatible with MSBuild).
I can reproduce the restore error with NuGet.exe 6.6.1, but not with NuGet.exe 4.3.1. 

The simple workaround to inhibit such restore error is:

set NUGET_RESTORE_MSBUILD_ARGS=/p:RestoreUseSkipNonexistentTargets=false && nuget restore MySolution.sln

Refer to https://github.com/NuGet/Home/issues/7796#issuecomment-465369065
Similar issue had been reported in VS Dev Community
https://developercommunity.visualstudio.com/t/nuget-restore-fails-when-it-encounters-a-non-stand/1170377

0 Kudos
rwg
Beginner
868 Views

That's a good solution. I will try it. Thank you very much.

0 Kudos
Reply