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

visual studio builds wrong project

Randy_M_
New Contributor I
844 Views

I suspect this is perhaps a VS bug and originally asked this on StackOverflow, but the only response I have had suggests it might be Fortran related.  On the off-chance it is (or the better chance that someone here has encountered something similar) here it is:

I'm currently moving a series of VS2005 32 bit solutions into VS2015 (update 3) for 64 bit implementation. The solution in question consists of 3 VB projects, 14 Fortran projects and one Assembler project.

When I build this solution, all projects are processed as expected. However, if I attempt to individually build any of the first three projects listed in the Solution Explorer pane, a different project is built.

This only happens for the first three projects in the list (all Fortran projects). The project that is actually built is always the same one. It is further down the Solution Explorer list and also a Fortran project. When I individually build any of the other projects in the solution, they are all built as expected.

I have been unable to find any link between the affected projects and the project which is actually being built and am at a loss understanding how to correct this.

The immediate work-around was to rebuild the entire solution whenever I need to rebuild one of the affected projects, however this requires somewhat more processing (and delay) than ideal.   I have subsequently found that this happens only if using the VS main menu (Build+[Re]Build ...project...).  The projects build correctly if using the Solution Explorer context menu "Project Only+Build Only ..."

Has anyone else encountered such a problem, and is there a simple fix?

Thanks, Randy

0 Kudos
1 Solution
jimdempseyatthecove
Honored Contributor III
844 Views

>>I'm currently moving a series of VS2005 32 bit solutions into VS2015 (update 3) for 64 bit implementation.

Moving solutions and projects amongst differing versions of VS is often problematic. It is much cleaner to recreate the solution and projects when experiencing such problems. In my experience, this is not necessarily an IVF problem as I've also experienced this with MS C++ projects as well.

Jim Dempsey

View solution in original post

0 Kudos
5 Replies
Steve_Lionel
Honored Contributor III
844 Views

I remember a customer reporting a similar issue to me many years ago. I asked him to send me the .vfproj and .sln files, but I could not reproduce it.

What I would suggest you try is creating a new "Visual Studio Solution" - without a project - then add your projects to it. If you have to set up project dependencies, do that next.

0 Kudos
jimdempseyatthecove
Honored Contributor III
845 Views

>>I'm currently moving a series of VS2005 32 bit solutions into VS2015 (update 3) for 64 bit implementation.

Moving solutions and projects amongst differing versions of VS is often problematic. It is much cleaner to recreate the solution and projects when experiencing such problems. In my experience, this is not necessarily an IVF problem as I've also experienced this with MS C++ projects as well.

Jim Dempsey

0 Kudos
Randy_M_
New Contributor I
844 Views

Hello, Steve & Jim,

Thanks for your suggestions.  They are definitely on the right track.  Steve it's very good to know that you are retired in name only.  I have been away from Fortran for several years, however I have greatly appreciated your help several times in the past. 

I first tried creating a new solution, added the projects to that and reset the dependencies.  Interestingly, the problem "changed".  It was still happening, but only to the second and third projects in the list, but now the project being built was different.  Following this I tested Jim's suggestion by deleting and completely recreating one of the affected projects.  This seems to have solved the problem (at least for that project).

So the lesson for me is to not depend on the automated update procedures.  This is too bad, because it is going to be a lot of nuisance to recreate all of the projects in all of the solutions I need to convert.  (In fact, because the work around is not too difficult, I may just use that until I find additional incentive for the complete rebuild.)

Thanks very much to you both for your help.

Best regards,
Randy

0 Kudos
jimdempseyatthecove
Honored Contributor III
844 Views

Randy,

Be careful to check that in addition to building the wrong project, you may have issues of not building a project with a dependency (not building a project when required). This may be hidden by the fact that your initial test (by chance) did what it ought to do.

Jim Dempsey

0 Kudos
Randy_M_
New Contributor I
844 Views

Thanks for that warning, Jim.  I will make a point of reviewing my final build output carefully to ensure that all is up to date.

Best regards,
Randy MacDonald

 

0 Kudos
Reply