SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: jporkkahtc on November 04, 2019, 06:33:45 pm

Title: Building VS2017 solution fails
Post by: jporkkahtc on November 04, 2019, 06:33:45 pm
When I try to build my vs2017 solution in Slick, it fails because MSBuild doesn't understand something in the csproj file.
The error:
Code: [Select]
error MSB4066: The attribute "Link" in element <Compile> is unrecognized.
error MSB4132: The tools version "15.0" is unrecognized.
Also, something creates "myProject.sln.cache" - I assume the old version of Msbuild does this?

Slick apparently adds some things to PATH:
Code: [Select]
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\bin
C:\WINDOWS\Microsoft.NET\Framework64v4.0.30319
C:\Windows\Microsoft.NET\Framework64\v3.5
C:\Windows\Microsoft.NET\Framework64\v2.0.50727
C:\Program Files (x86)\Windows Kits\8.1\bin
But, this is a VS2017 project, so I would expect it to add VS2017 things to the path instead.

Turns out, I've got a lot of versions of MSBuild on my machine.
In this case, Slick ought to be using
Code: [Select]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\amd64\MSBuild.exe
When I specify the full path to that MSBuild in project->Properties->Build, I get another failure:
Code: [Select]
error MSB4126: The specified solution configuration "Debug|AnyCPU" is invalid.
Turns out, it needs to be "Any CPU" -- with a space.


In the attached solution, I've updated the path for MSBuild to demonstrate the "Any CPU" problem.

This is a freshly created solution direct from VS2017, then opened in Slickedit.
Title: Re: Building VS2017 solution fails
Post by: Clark on November 05, 2019, 02:07:25 am
We will look into this. Thanks for posting
Title: Re: Building VS2017 solution fails
Post by: Clark on November 05, 2019, 08:31:23 pm
Try loading this new vchack.e for v24.0.0.8

I'm hoping this fixes both issues. However, I only have a bunch of professional editions installed and not community.

Try starting over (deleting the .vpw, .vpj, vtg, .vpwhistu files).  For me, it finds the correct MSBuild and I have 3 versions installed.
Title: Re: Building VS2017 solution fails
Post by: jporkkahtc on November 05, 2019, 08:49:21 pm
Works, but when I build I get the following warning.

CSC : warning CS1668: Invalid search path 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x64' specified in 'LIB environment variable' -- 'directory does not exist' [C:\Users\jporkka\source\SolutionTest2017\SolutionTest2017\SolutionTest2017.csproj]

I do not have an "ATLMFC" directory there.
I do have two others:
Code: [Select]
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\ 
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\ 

Code: [Select]
LIB=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64
Title: Re: Building VS2017 solution fails
Post by: Clark on November 06, 2019, 03:17:19 am
Give this one a try. I put some extra code in to only add LIB directories that exist. There are some directories which are only needed for C++ dev and not C#.
Title: Re: Building VS2017 solution fails
Post by: jporkkahtc on November 06, 2019, 07:52:16 pm
works great, thanks!
Title: Re: Building VS2017 solution fails
Post by: Clark on November 06, 2019, 08:24:14 pm
Thanks for verifying this. I'll add this as a hot fix.