如何以编程方式构建一个Visual Studio解决方案? [英] How to programmatically build a visual studio solution?

查看:196
本文介绍了如何以编程方式构建一个Visual Studio解决方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过传递解决方案文件路径(.sln文件),并构建模式(调试,发布)编译的解决方案。
我不想这样调用devenv.exe的或msbuild.exe一个命令行程序,而不是我想用的API,并知道是否有编译错误。

I would like to compile a solution by passing the solution file path (.sln file) and the build mode (debug, release). I do not want to call a command line process like devenv.exe or msbuild.exe, instead I would like to use an API and know if there were compile errors.

这可能吗?
请提供样品,如果你认为你知道该怎么做。

Is it possible ? Please provide samples if you think you know how to do that.

推荐答案

你将不得不在某个时候启动一个进程,你还不如产卵的过程揭开序幕汇编编译。这将是比使用API​​挣扎要容易得多。

You're going to have to launch a process at some point to do the compilation you might as well spawn a process to kick off the compilation. It is going to be much easier than struggling with an API.

修改安德鲁提供有关你可能会如何去做,但我仍然认为这是一个错误的一些很好的建议。

Edit Andrew gives some good advice about how you might go about it but I still think it is a mistake.

这篇关于如何以编程方式构建一个Visual Studio解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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