SlickEdit Community

Archived Read Only Forums => SlickEdit 2015 v20 Beta Discussion => Topic started by: Marcel on October 02, 2015, 02:19:16 pm

Title: B2: VS 2013 Solution detection fails (Win64)
Post by: Marcel 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.
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Lee 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.
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Marcel on October 16, 2015, 12:19:04 am
Not yet fixed in B3.
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Lee 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?
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Marcel 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
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Lee 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.
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Marcel 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).
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Clark 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.
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Marcel 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.
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Marcel on October 22, 2015, 03:21:02 am
Not fixed in RC1, but I guess you already knew that. ;)
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Lee 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.
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Marcel 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?
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Lee on October 22, 2015, 02:20:31 pm
Support for Visual Studio 2015 is in the current RC release.
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Marcel 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).
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Lee 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.
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Marcel on October 29, 2015, 03:01:43 pm
RC3 has this fix:

"Options for choosing the Visual Studio version used for a Visual Studio solution has been added. By default, it looks for the tool set version used in one of the projects."

Where are these new options? I opened a .sln and didn't get to choose.
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Lee on October 29, 2015, 03:27:28 pm
We were able to some tweaks to try to help this, but did not a chance to update documentation.  Is it still selecting the incorrect version of Visual Studio in your case?  At the very least, it should be picking the latest version of Visual Studio you have installed.
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Marcel on October 29, 2015, 04:15:32 pm
The machine I tested RC3 with had 2015 installed. The solution contains

Code: [Select]
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1

RC3 picked toolset 12, it should "upgraded" to 14.  A manual override would have been very useful.

Btw, the compile/link tab in the project properties doesn't seem to do anything.
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Lee on October 29, 2015, 04:41:09 pm
The updated version no longer relies on solution file.  It should not be looking there at all.  We did add a new def-var that will allow you to override, which is off by default.   On the SlickEdit command-line you can use:
Code: [Select]
set-var def_use_visual_studio_version 14
That should pick the Visual Studio 2015 toolset for building if devenv is not already found on PATH.  The updated version by default uses the following search:

1) If devenv is found in PATH, use the that version.
2) If def_use_visual_studio_version is set to non-zero use the toolset version specified (14 is Visual Studio 2015, 12 -> Visual Studio 2013, 11 -> Visual Studio 2012, 10 -> Visual Studio 2010).
3) Search vcxproj files for PlatformToolset. 
4) Use latest installed version of Visual Studio.

We also added an additional macro variable that sets the order of tests: def_auto_visual_studio_select.  This is a comma delimited string, and defaults to: project,latest,solution,prompt.

After checking PATH and def_use_visual_studio_version, it will use the checks defined in def_use_visual_studio_version
project:  Search vcxproj files for PlatformToolset setting.
latest:  Use latest installed version of Visual Studio.
solution:  Use version specified in .sln file (same method from)   
prompt:  Select version from installed versions of Visual Studio (new command: vstudio_select_environment)

You can re-order the tests in with this def-var, in case some would rather have it check solution first.  You would probably be best suited to use the def_use_visual_studio_version and just set it to the version you want.
Title: Re: B2: VS 2013 Solution detection fails (Win64)
Post by: Marcel on October 29, 2015, 05:29:02 pm
Thanks Lee.
This appears to work for my VS 2015 scenario. I'll try a few more solutions.