2

I'm using VS2013 (c# project), and in thePost Build Event I have the following command

Xcopy "$(SolutionDir)Lib" "$(SolutionDir)Exe_path\Lib\" /s /e /y
call "$(VS120COMNTOOLS)..\tools\vsvars32.bat"
editbin /largeaddressaware "$(TargetPath)"

Everything was working well, then I restart my pc (with some modification related to the windows policy like disable edit some values in the the reg that's not related to my project).

After restarting the PC, I tried to compile the application, but I got two errors:

Errors 1:

Cannot determine the location of the VS Common Tools folder.

And the second one is:

The command "call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\..\tools\vsvars32.bat"
editbin /largeaddressaware "my_exe_path"" exited with code 9009

I know that Error Code 9009 means error file not found, but the vsvars32.bat is exist and the path is correct, and all other paths are correct, I mean both $(SolutionDir)Lib and $(SolutionDir)Exe_path\Lib\ are correct and exist.

I tried some solution from here like:

call "$(DevEnvDir)..\Tools\vsvars32.bat"

But I get exactly the same error message.

Also I tried to write the full path for Xcode like

c:\windows\system32\xcopy.exe "$(SolutionDir)Lib" "$(SolutionDir)\ExepathLib\" /s /e /y
    call "$(VS120COMNTOOLS)..\tools\vsvars32.bat"
    editbin /largeaddressaware "$(TargetPath)"

Again same error.

I also check the PATH in the environment path and it's contains C:\WINDOWS\system32; according to some suggested solutions here.

Most probably that when the new windows policy is applied it affect on reg, but I'm not sure if that is correct.

What's the most possible reason that make this issue happen, and what's the suggestion to solve it.

Edit:

I tried to open VS2012 x64 Native Tools Command Prompt and an error message is appear, it's the same error message

ERROR: Cannot determine the location of the VS Common Tools folder.

So I checked the vcvars32.bat and it contains

@if "%VS120COMNTOOLS%"=="" goto error_no_VS120COMNTOOLSDIR

That's mean if it can't find the VS120COMNTOOLS environment variable so it will go to error_no_VS120COMNTOOLSDIR

@echo ERROR: Cannot determine the location of the VS Common Tools folder.

So I think it's most probably because of that the win policy system prevent to edit VS120COMNTOOLS value in the environment variables.

Community
  • 1
  • 1
Hazem Abdullah
  • 1,837
  • 4
  • 23
  • 41

0 Answers0