如果我从 Visual Studio 运行构建,如何将所有日志输出记录到带有通配符的文件中 [英] How do i log all logging output to a file with wildcards if i run the build from visual studio

查看:37
本文介绍了如果我从 Visual Studio 运行构建,如何将所有日志输出记录到带有通配符的文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有很多关于如何在从控制台手动调用 msbuild 时捕获日志输出的帖子,但我想知道是否有任何方法可以使用通配符(时间戳、配置等)将所有日志输出记录到我想要的文件中,如果构建是从 Visual Studio 触发的.

不 - 从控制台运行它不是一种选择.我花了 2 天的时间试图让它工作.似乎 Xamarin 目标在构建时并没有考虑到开发人员友好的构建自动化.

为什么它不是一种选择?- 错误的工具集,- 错误的 MSBuild,- mtouch警告,- 期望在运行时似乎由 VS 添加的环境变量的目标

所以我放弃了,我正在寻找一种方法来捕获我的日志,以便我可以将输出与其他工件一起转储到一个文件中.

解决方案

如果我从 Visual Studio 运行构建,我如何将所有日志输出记录到带有通配符的文件中

根据

默认文件名将带有Output-Build"的名称,您可以将其更改为您想要的名称,但名称中不能使用通配符.

希望这会有所帮助.

There are plenty of posts on how to capture logging output while manually invoking msbuild from the console but i am wondering if there is any way to log all logging output to a file of my desire using wildcards (timestamps, Configuration etc) if the build is fired from Visual Studio.

No - running it from console is not an option. I've spent 2 days trying to get it to work. Seems like the Xamarin targets were not built with dev friendly build automation in mind.

Why is it not an option? - Wrong toolset, - wrong MSBuild, - mtouch warnings, - targets which expect env variables which seem to be added by VS at runtime

so i gave up and am looking for a way to capture my logs so i can dump the output into a file together with other artifacts.

解决方案

How do i log all logging output to a file with wildcards if i run the build from visual studio

According to the How to: View, Save, and Configure Build Log Files:

After you build a project in the Visual Studio IDE, you can view information about that build in the Output window. By using this information, you can, for example, troubleshoot a build failure. For C++ projects, you can also view the same information in a .txt file that's created and saved automatically. For managed-code projects, you can copy and paste the information from the Output window into a .txt file and save it yourself. You can also use the IDE to specify what kinds of information you want to view about each build.

If you build any kind of project by using MSBuild, you can create a .txt file to save information about the build. For more information, see Obtaining Build Logs.

We could to know log file from Visual Studio is only supported for C++ projects. we have to work with the output window for others.

If you do not want to copy and pasting the content to a text file. Here is a quiets way to avoid copy past and save the content directly:

Follow these steps: 1. Set the focus to the Output Window 2. From the main menu navigate to File –> Save Selected Items (Ctrl + S) or Save Output As.

To save the content directly in to a text file.

Default filename will have the name with "Output-Build", you can change it to what you want, but it could not use wildcards in the name.

Hope this helps.

这篇关于如果我从 Visual Studio 运行构建,如何将所有日志输出记录到带有通配符的文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆