简体   繁体   English

Visual Studio 2013 C#构建输出到文件

[英]Visual Studio 2013 C# Build Output to File

I'm using Visual Studio 2013 at work and I want my C# build output to be saved to a file I've specified. 我正在使用Visual Studio 2013,我希望将我的C#构建输出保存到我​​指定的文件中。 I found Tools > Options > Projects and Solutions > Build and Run which allows me to set build output and build log file verbosity but there's nothing which indicates the path of a build file. 我找到了工具>选项>项目和解决方案>构建和运行,它允许我设置构建输出和构建日志文件详细程度,但没有任何内容指示构建文件的路径。 I also can't find any such files in bin or obj folders. 我也无法在binobj文件夹中找到任何此类文件。

I've also found this article which has instructions for manually copying build output to a text file. 我还发现这篇文章有关于手动将构建输出复制到文本文件的说明。 What I want is some way to have that output written to a file automatically, if possible. 如果可能的话,我想要的是将输出自动写入文件的某种方法。

[Edit] I'd like to avoid command-line tools (ie I want to build in Visual Studio) and I hope to avoid writing a custom logger class. [编辑]我想避免使用命令行工具(即我想在Visual Studio中构建),我希望避免编写自定义记录器类。


I put a screen cap of the options section I referenced above here . 我把选项部分我上面提到的屏幕顶盖在这里

I also couldn't find any option in Visual Studio, but you can use msbuild from console and log the output to a file 我也在Visual Studio中找不到任何选项,但您可以从控制台使用msbuild并将输出记录到文件中

msbuild MyProject.proj /t:go /fl /flp:logfile=MyProjectOutput.log;verbosity=diagnostic

Also have a look here for more options: http://msdn.microsoft.com/en-us/library/ms171470.aspx 另请查看更多选项: http//msdn.microsoft.com/en-us/library/ms171470.aspx

You need to set the Output path property. 您需要设置输出路径属性。 Do the following: 请执行下列操作:

  1. In Solution Explorer right click the project and select Properties 在Solution Explorer中,右键单击该项目,然后选择“ Properties
  2. Select the Build tab 选择“ Build选项卡
  3. Enter the path in Output path: Output path:Output path:

输出路径

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM