将Visual Studio 2017构建输出重定向到队列中的txt文件,重定向第一个解决方案构建输出后,其他进程正在使用该文件 [英] Redirect Visual Studio 2017 build output to txt file in queue, the file is being used by other process after redirect the first solution build output

查看:248
本文介绍了将Visual Studio 2017构建输出重定向到队列中的txt文件,重定向第一个解决方案构建输出后,其他进程正在使用该文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有很多VS 2017 15.8的解决方案,我使用batch命令在队列中构建它们并将构建输出重定向到'.txt '档案。当第一个解决方案构建完成并且输出重定向到.txt文件时,但第二个解决方案失败了
以将输出重定向到具有错误的文件:"该进程正被其他进程使用"。我使用'devenv.exe'进行构建,我检查了操作系统中的任务列表,当错误发生时,'devenv.exe'的进程已经关闭。



所以我不确定使用日志文件的是什么。尝试重定向下一个解决方案时,似乎将输出重定向到日志操作尚未完成。我尝试在第二个解决方案开始之前添加超时1秒,然后就可以了。



我的环境:


运作良好: 


    VS 2017 Enterprise 15.5与Win 7 SP1


不可用:


    VS 2017 Enterprise 15.8 with Win 10 1809



可以帮助吗?

解决方案

你好JAY Jie,


欢迎来到MSDN论坛。


解决方案是否也适用于Win10 1809?


从您的描述中,我担心您的设置超时的解决方案是解决此问题的正确方法。


BTW,因为论坛正在讨论MSbuild,所以我建议你可以使用。


预计会有任何反馈。


最好的问候,


Dylan







Hi,

I have many solutions of VS 2017 15.8 to be built, I use batch command to build them in queue and redirect the build output to a '.txt' file. When the first solution build finished and the output is redirected to the .txt file, but the second solution failed to redirect output to the file with error: "The process is being used by other process." I use 'devenv.exe' to do build and I checked the task list in OS, when the error occurred, the process of 'devenv.exe' has already been closed.

So I am not sure what is using the log file. It seems that redirect the output to log action has not finished when trying to redirect the next solution. I tried to add a timeout for 1 second before the second solution start and it works.

My Environment:

Works well: 

    VS 2017 Enterprise 15.5 with Win 7 SP1

Not Works:

    VS 2017 Enterprise 15.8 with Win 10 1809

Could any one help?

解决方案

Hi JAY Jie,

Welcome to MSDN forum.

Did the solution also work in the Win10 1809?

From your description, I'm afraid your solution which is about setting timesout is right method to solve this issue.

BTW, since the forum is discussing about MSbuild, so I suggest you could use msbuild.exe to build your solution. And after experiment in my side, it can work even the file is opened. Please follow the steps below:

#1 download and install the build tools visual studio 2017

#2 add the msbuild.exe folder into environment variables

C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin


#3 type the sample command line in the cmd 

msbuild [yoursln].sln -flp:logfile=build.txt

Please refer the doc for more command line.

Any feedback will be expected.

Best Regards,

Dylan



这篇关于将Visual Studio 2017构建输出重定向到队列中的txt文件,重定向第一个解决方案构建输出后,其他进程正在使用该文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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