Author Topic: B2: VS 2013 Solution detection fails (Win64)  (Read 11812 times)

Marcel

  • Senior Community Member
  • Posts: 261
  • Hero Points: 26
B2: VS 2013 Solution detection fails (Win64)
« on: October 02, 2015, 02:19:16 PM »
Opening a VS2013 solution produces a project that doesn't work.

vchack mis-classifies the solution as VS2012, it should probably take a peek at the Visual Studio comment line that's been in .sln since 2012 (although the line doesn't get updated if you open a 2012 .sln with 2013). Maybe there is a way to hook into the Version Studio version selector to make this less painful.

If in doubt, pop up a dialog the first time the solution is opened and ask me to pick a version.

You can use the attached solution to repro the problem. There are also a bunch of screen shots to show the state of the project. 
In the interest of full disclosure; this machine had at some point VC 6, VS 2008, 2010, 2012, 2013 and 2015 installed. All but VC6 and VS 2013 have been uninstalled, but I am sure that the uninstallers left a bunch of registry and/or file artifacts behind that could mislead VS.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: B2: VS 2013 Solution detection fails (Win64)
« Reply #1 on: October 02, 2015, 02:55:08 PM »
Thanks for the report.  I am able to reproduce the issues reported and will try to have those addressed for next Beta release.

Marcel

  • Senior Community Member
  • Posts: 261
  • Hero Points: 26
Re: B2: VS 2013 Solution detection fails (Win64)
« Reply #2 on: October 16, 2015, 12:19:04 AM »
Not yet fixed in B3.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: B2: VS 2013 Solution detection fails (Win64)
« Reply #3 on: October 16, 2015, 03:04:50 PM »
Some background on this:  Prior to Visual Studio 2013, we had been using the top-line Format Version string to try to determine the version for the environment settings.   They stopped incrementing that version number after Visual Studio 2012, but they did add some new properties to the solution file (VisualStudioVersion, MinimumVisualStudioVersion) and we made some assumptions that those were available.  The attached sample does not have those properties, and that is how we got here.  Did you create this solution in Visual Studio 2013 or was this imported from an earlier Visual Studio or auto-generated from something like CMake?

Marcel

  • Senior Community Member
  • Posts: 261
  • Hero Points: 26
Re: B2: VS 2013 Solution detection fails (Win64)
« Reply #4 on: October 16, 2015, 03:21:49 PM »
The one I attached was created in VS2013.
I also have another project created in VS2012 which does not have the #VisualStudio line. Opening it under VS2013 DID NOT add the #VisualStudio comment, basically left it unaltered.

To make matters worse, I currently work in an environment that is routinely using 6, 2012, 2013 and soon 2015, with some 2012 solutions that HAVE to be used with 2012 (last one with DBCS), and some that are used with 2013.
I know that this is messy, that's why MS introduced the selector which is supposedly able to figure all this out.
 I really wouldn't mind if you would pop up a box and ask me which VS version I wanted to use with the solution (the first time, anyway).

Marcel

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: B2: VS 2013 Solution detection fails (Win64)
« Reply #5 on: October 16, 2015, 05:33:18 PM »
We have may have to add some additional fallbacks cases to handle the case of missing VisualStudioVersion property.  Most solutions I have seen do have a product identifier commented in the header (ex: # Visual Studio 2012).  We may be able to just grep for that and match the string to a version number.

If you have a 2012 solution with nothing in solution file it to help us identify it as 2013, then it will try to find the environment for Visual Studio 2012.   What we don't currently have are fallbacks in the case where it identifies a version of Visual Studio, and you don't actually have it installed.  That could get really hairy, I am not real sure what the compatibility of solutions versions are with different versions of Visual Studio.  2012 -> 2013 appears to work okay, but after that ???   We may have to just fallback to your suggestion and just prompt.  If you are okay with that, that might be what we have to go with.

Marcel

  • Senior Community Member
  • Posts: 261
  • Hero Points: 26
Re: B2: VS 2013 Solution detection fails (Win64)
« Reply #6 on: October 16, 2015, 06:21:10 PM »
I am OK with prompting because it allows me to get out of an otherwise unresolvable situation, namely that I have a 2012 solution but 2012 has been uninstalled and replaced by 2013 (or 2015).

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: B2: VS 2013 Solution detection fails (Win64)
« Reply #7 on: October 16, 2015, 06:40:26 PM »
You could try putting lines like the following after the comment line (line with #) in your .sln file:

VisualStudioVersion = 12.0.???
MinimumVisualStudioVersion = 10.0.40219.1

Not sure if you need the exact version information or not. Worth a shot though. This will force SlickEdit to recognize the file as a Visual Studio 2013 solution.

Marcel

  • Senior Community Member
  • Posts: 261
  • Hero Points: 26
Re: B2: VS 2013 Solution detection fails (Win64)
« Reply #8 on: October 16, 2015, 07:15:14 PM »
Alas, I don't own the .sln(s) and would have a hard time justifying such changes.
I can always (continue) patching vchack.e, looking for the comment line "# Visual Studio <version>" which is apparently what the VS solution selector is doing, then setting the toolbox version.

Marcel

  • Senior Community Member
  • Posts: 261
  • Hero Points: 26
Re: B2: VS 2013 Solution detection fails (Win64)
« Reply #9 on: October 22, 2015, 03:21:02 AM »
Not fixed in RC1, but I guess you already knew that. ;)

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: B2: VS 2013 Solution detection fails (Win64)
« Reply #10 on: October 22, 2015, 12:20:56 PM »
I don't think we can get this addressed before final release.   Probably have to come in as hotfix or in followup point release.

Marcel

  • Senior Community Member
  • Posts: 261
  • Hero Points: 26
Re: B2: VS 2013 Solution detection fails (Win64)
« Reply #11 on: October 22, 2015, 02:18:39 PM »
I haven't tried it yet, but does that mean that VS 2015 support is also off the list for this release?

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: B2: VS 2013 Solution detection fails (Win64)
« Reply #12 on: October 22, 2015, 02:20:31 PM »
Support for Visual Studio 2015 is in the current RC release.

Marcel

  • Senior Community Member
  • Posts: 261
  • Hero Points: 26
Re: B2: VS 2013 Solution detection fails (Win64)
« Reply #13 on: October 23, 2015, 02:25:50 AM »
FYI - RC1 has the same problem with VS 2015 (thinks it needs to use Toolset V11 instead of V14).

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: B2: VS 2013 Solution detection fails (Win64)
« Reply #14 on: October 23, 2015, 03:40:05 PM »
This may be even more problematic than first thought.   I can load older solution files in Visual Studio 2015, and instead of upgrading the solution files as it has done in the past it now just upgrades the project files to use the new platform toolset.  The solution file alone isn't going to be any help in setting up the correct Visual Studio environment going forward.  This is fixable, but will not make final release candidate.  It will be a high priority and will attempt to address this via hotfix (if possible) or in followup release.