我如何获得Msbuild.Exe路径 [英] How Do I Get The Msbuild.Exe Path

查看:1152
本文介绍了我如何获得Msbuild.Exe路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,



我正在使用Visual studio构建示例WIX项目。

为此,我需要'msbuild.exe'路径。(例如:C:\ WindowsD.Microsoft.NET \ Framework \v4.0.30319)

如何使用C#枚举'msbuild.exe'路径。

是否有任何API可以获取最新版本的msbuild.exe路径。



提前致谢。



问候,

Dileep

Dear All,

I am building sample WIX Project using Visual studio.
For that, I need 'msbuild.exe' path.(Ex: C:\Windows\Microsoft.NET\Framework\v4.0.30319)
How can i enumerate the 'msbuild.exe' path using C#.
Is there any API to get the latest version msbuild.exe path.

Thanks in advance.

Regards,
Dileep

推荐答案

如果您要创建构建工具链,那么只需复制 MSBUILD.EXE 工具文件夹,例如脚本中该目录的引用。
If you are creating a build tool chain then just copy the MSBUILD.EXE to a Tools folder for example and reference from that directory in your scripts.


To获取当前运行时.Net框架路径使用以下行:

System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()
To get the current runtime .Net framework path use the below line:
System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()


这篇关于我如何获得Msbuild.Exe路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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