0

We have a VS 2015 solution, just ported from VS2010. It contains a project with a PostBuildEvent. In this PostBuildEvent, svcutil.exe is called.

So far, the path to svcutil.exe was

"$(VS100COMNTOOLS)\..\..\..\Microsoft SDKs\Windows\v7.0A\Bin\svcutil"

This is not portalbe. On the new build server, there is no such directory.

We obviously need a macro to the Windows SDK Tools folder. On the new build server, this is currently

C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin

Of course I could define my own macro and pass it on somehow, but isn't there a build-in solution?

Moritz Both
  • 1,598
  • 1
  • 13
  • 21
  • 1
    have you tried GetFrameworkSdkPath like in http://stackoverflow.com/questions/442476/ddg#849449 or perhaps something like $(WindowsSdkDir) ? – stijn Mar 15 '17 at 12:38
  • @stijn That hint was helpful, thank you. My solution still is not elegant: GetFrameworkSdkPath is a task, it can be run in a target only. Tasks are run after PropertyGroups are evaluated by msbuild, so I had to move the PostBuildEvent Property into a target. Don't know yet what VS tells me about it. But it works for now! – Moritz Both Mar 15 '17 at 16:04
  • Also, hint for dockdockgoers: For migration to .Net 4.0, we must use the svcutil from `C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools` – Moritz Both Mar 15 '17 at 16:06
  • replace VS100COMNTOOLS with VS140COMNTOOLS to get VS2015 data. do if calls to see if the variable is set: http://stackoverflow.com/a/31568416/1466046 – magicandre1981 Mar 15 '17 at 16:39
  • 1
    @magicandre1981 the build server has no Visual Studio. Also, the VS version does not have a 1:1 relation to the Windows SDK directory as far as I understand. – Moritz Both Mar 15 '17 at 17:17
  • 1
    @Moritz Both, Glad to know that you have resolved this issue. You can write your solution as answer and mark it which is benefit to other communities who has the same problem. Thanks. – Leo Liu Mar 16 '17 at 04:21

0 Answers0