0

I need to build project B before building project A, using MSBuild.

I've tried to write "D:\Visual Studio\IDE\MSBuild\Current\Bin\MSBuild.exe" $(SolutionDir)\FeedBack.App\FeedBack.App.csproj -property:Configuration=Debug in project A prebuild command line, but I've got different errors before building it.

Question: What do I need to change in the command?

Nguyễn Văn Phong
  • 13,506
  • 17
  • 39
  • 56
  • 2
    Did you try this one? https://stackoverflow.com/a/9736187/9071943 – Nguyễn Văn Phong Dec 16 '19 at 09:45
  • What are the errors? Are they compile errors? – Ryan Thomas Dec 16 '19 at 10:04
  • @Ryan Thomas, yes, compile errors with exit codes. The last one, I remember, was 9009 – Харламов Даниил Dec 16 '19 at 10:06
  • @Phong, I've tried to do like in that topic, but I it didn't help, because, I don't exactly understand, how it works and what should be written there – Харламов Даниил Dec 16 '19 at 10:31
  • can you build each project separately without error? Or face the same issue? Please check whether the path of the msbuild.exe and project path is correct. In addition, please share the error message or A.csproj file. It will help us troubleshoot your issue. – Mr Qian Dec 17 '19 at 07:53
  • @PerryQian-MSFT, sorry for late answer. Both projects build well separately. I've tried write this command in different variants and got a lot of different results. Different exit codes: 3, 123, 9009, or message, that MSBuild.exe is not a command, sometimes another Visual Studio has been executed... I'm doing it in project A properties, in before-build events. – Харламов Даниил Dec 20 '19 at 06:43

1 Answers1

0

The problem was, that I haven't had the path to msbuild file as evironment variable in Windows properties.