What is the default location for MSBuild logs?

I am using Visual Studio Express 2012. Where is the log file located? I searched in the folder where my solutions and projects are stored, but I can not find the .log file.

This is the configuration for logging:

enter image description here

+85
visual-studio visual-studio-2012 msbuild
Jul 17 '12 at 16:09
source share
4 answers

Visual Studio log file is supported only for C ++ projects. You just need to work with the output window for others.

See this similar topic: VS2010: minimal assembly log in output and verbose log in log file

And in case you do this for a C ++ project, the file is located at :

... the assembly log in the intermediate file directory ... The path and name of the assembly log are represented by the macro expression MSBuild, $(IntDir)\$(MSBuildProjectName).log .

+90
Jul 17 '12 at 19:22
source share

The msdn documentation is pretty straightforward (and you won't like it!):

https://msdn.microsoft.com/en-us/library/jj651643.aspx

Where does he say:

Create an assembly log file for a managed code project. In the menu bar, select Build, Build Solution.

In the Output window, select the information from the assembly, and then copy it to the clipboard.

Open a text editor such as Notepad, paste the information into a file, and then save it.

+17
Oct. 06 '16 at 18:16
source share

Use assembly output instead of writing to a file. Instead of copying / pasting, just click somewhere in the output and press CTRL + S to save. Visual Studio will ask you for a location (tested with Visual Studio 2017, but I assume this works in earlier versions as well).

enter image description here

+13
May 24 '18 at 8:54
source share

Although it is true that VS does not allow this directly, you can still build using MSBuild "inside" VS2015 and get both the output of the build window and the log file as follows: (Perhaps this is a little hack.)

  • In your VS Managed solution, add a new project (call it "Make"). but. The type of project you want is a Visual C ++ / NMake project.
  • Identify the MSBuild commands you need on the command line (see below).
  • Reconfigure the solution to create an NMake project instead of regular managed projects.

This will create a project with the Build, Rebuild, and Clean command line commands where you can directly execute MSBuild. For example:

Recover: MSBuild.exe /ds /v:diag /property:Configuration=Debug ..\BuildTest\BuildTest.csproj /t:Clean,Build

Build: MSBuild.exe /ds /v:diag /property:Configuration=Debug ..\BuildTest\BuildTest.csproj /t:Build

Clear: MSBuild.exe /ds /v:diag /property:Configuration=Debug ..\BuildTest\BuildTest.csproj /t:Clean

You can also specify multiple command lines MSBuild.EXE to create multiple projects. For the usual result of building the whole solution, you can target only the final assemblies and allow the dependency graph to generate individual goals.

This will create a .log file, where NAME is the name of the NMake project you used. In the above example, the log would be make.log.

A working example is available on GitHub: https://github.com/bitblitz/VS_MsbuildExample (Tested with VS2015)

Note that building individual projects directly will be done with the usual VS behavior, but you can build a complete solution inside VS and get build logs.

+1
Jul 16 '17 at 21:22
source share



All Articles