Author Topic: Building VS2017 solution fails  (Read 165 times)

jporkkahtc

  • Senior Community Member
  • Posts: 1837
  • Hero Points: 178
  • Text
Building VS2017 solution fails
« 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.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4922
  • Hero Points: 402
Re: Building VS2017 solution fails
« Reply #1 on: November 05, 2019, 02:07:25 am »
We will look into this. Thanks for posting

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4922
  • Hero Points: 402
Re: Building VS2017 solution fails
« Reply #2 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.

jporkkahtc

  • Senior Community Member
  • Posts: 1837
  • Hero Points: 178
  • Text
Re: Building VS2017 solution fails
« Reply #3 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

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4922
  • Hero Points: 402
Re: Building VS2017 solution fails
« Reply #4 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#.

jporkkahtc

  • Senior Community Member
  • Posts: 1837
  • Hero Points: 178
  • Text
Re: Building VS2017 solution fails
« Reply #5 on: November 06, 2019, 07:52:16 pm »
works great, thanks!

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4922
  • Hero Points: 402
Re: Building VS2017 solution fails
« Reply #6 on: November 06, 2019, 08:24:14 pm »
Thanks for verifying this. I'll add this as a hot fix.