1

I have inherited a large codebase which I am trying to build with Visual Studio 2019. One of the projects is using a target for LargeAddressAware with the following content:

    <?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <Target Name="MakeApplicationLargeAddressAware" AfterTargets="Build" Condition=" '$(Platform)' != 'x64' ">

    <ItemGroup>
      <SearchPath Include="$(VS160COMNTOOLS)..\..\VC\Tools\MSVC\**\x64\editbin.exe" Condition=" EXISTS('$(VS160COMNTOOLS)..\..\VC\Tools\MSVC\') " />
    </ItemGroup>

    <PropertyGroup>
      <EditBinPath Condition=" '$(EditBinPath)' == '' ">%(SearchPath.FullPath)</EditBinPath>
    </PropertyGroup>

    <Error Text="The editbin.exe could not be found.  Please make sure you have the c++ tools installed for Visual Studio!" Condition=" '$(EditBinPath)' == '' " />
    <Message Text="Found editbin.exe at $(EditBinPath)" />
    <Exec Command="&quot;$(editbinpath)&quot; /LARGEADDRESSAWARE &quot;$(TargetPath)&quot;" />
  </Target>
</Project>

I am continuously getting the following error in build:

The editbin.exe could not be found. Please make sure you have the c++ tools installed for Visual Studio!

I have selected the C++ desktop development workload during installation and I have manually checked and verified that the path for editbin wrt VS160COMNTOOLS is correct and the file exists.

Can anybody help me in understanding why the build is not able to locate the editbin.exe file?

One additional point I discovered is that I can echo %VS160COMNTOOLS% from the VS2019 developer command prompt and it resolves to the correct value. But when I use an echo task within the targets file, $(VS160COMNTOOLS) resolves to a blank string.

koder
  • 887
  • 9
  • 29
  • The macro just works in developer community command prompt. You can directly build the project in command prompt. And in visual studio, the macro seems to be removed. – Dylan Jun 30 '21 at 05:56

0 Answers0