In Visual Studio 2010 we have under 'tools|options|projects and solutions|build and run' (couldn't find a correct image on the internet) two options for the logging of MSBuild:
'MSBuild project build output verbosity' and 'MSBuild project build log verbosity'.
So I was hoping to be able to get a minimal build log in the output view within Visual Studio devenv (correct) while at the same time a detailed build log in some log file.
I cannot find a way to configure a build log file to appear.
Note: I do not want to configure my own MSBuild.
To create a build log file for a managed-code projectOn the menu bar, choose Build > Build Solution. In the Output window, click somewhere in the text. Press Ctrl+S. Visual Studio prompts you for a location to save the build output.
To display the Output window whenever you build a project, in the Options dialog box, on the Projects and Solutions > General page, select Show Output window when build starts.
Start Visual Studio ( devenv.exe ) with /Log parameter. You can press Start+R and then enter the command below for Visual Studio 2019 Enterprise. Change the path to devenv.exe depending on the actual Visual Studio version. The log file will be found in %AppData%\Microsoft\VisualStudio\ , under a subdirectory (*).
Log file from Visual Studio is only supported for C++ projects. You just have to work with the output window for others.
http://msdn.microsoft.com/en-us/library/b0bktkzs.aspx says:
Examine the build log in the intermediate files directory to see what actually executed. The path and name of the build log is represented by the MSBuild macro expression, $(IntDir)\$(MSBuildProjectName).log.
[And the easiest way to get there is to do Project|Show all files, then go to Solution Explorer and right click to Open Folder in Windows Explorer]
EDIT: To appease our disgruntled -1er... You could obviously infer from this that you could add a <Execute Command="notepad.exe $(IntDir)\$(MSBuildProjectName).log"/>
or similar if it needs to literally pop up, but that doesnt make sense to me.
EDIT 2: EXAMPLE. Edit the .csproj file, and in the section with
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
-->
Change it to:
<Target Name="AfterBuild">
<Exec Command="notepad.exe $(IntDir)\$(MSBuildProjectName).log" />
</Target>
Reason I didnt expand it out is that this would get annoying quick. You could potentially put:
notepad.exe $(IntDir)\$(MSBuildProjectName).log
In your Post Build step. This would work slightly better as it would only fire when the compile has actually done something.
BTW highly recommend getting the Hashimi book - it makes all this stuff obvious and makes you give answers that assume its straightforward :P
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With