在没有 Visual Studio 的情况下编译 .vbproj 或 .csproj 项目文件 [英] Compiling a .vbproj or .csproj project file without Visual Studio
问题描述
有没有办法像 Visual Studio 一样直接编译 .vbproj 或 .csproj 项目文件?
Is there a way to compile a .vbproj or .csproj project file directly, just like Visual Studio does?
在 Visual Studio 中编译时,输出"窗口显示对编译器的实际调用,通常如下所示:
When you compile in Visual Studio, the "output" window shows the actual call to the compiler, which normally looks like:
vbc.exe [一堆选项] [looooong .vb 文件列表]
vbc.exe [bunch of options] [looooong list of .vb files]
我想以编程方式调用某物",它会使用 .vbproj 文件并执行 Visual Studio 所做的任何操作来生成这个长命令行.我知道我可以自己解析 .vbproj 并生成该命令行,但我宁愿省去所有的逆向工程和反复试验...
I would like to programatically call "something" that would take the .vbproj file and do whatever Visual Studio does to generate this long command line. I know i could parse the .vbproj myself and generate that command line, but I'd rather save myself all the reverse engineering and trial-and-error...
有没有工具可以做到这一点?我宁愿能够在没有安装 Visual Studio 的机器上完成它.但是,如果有一种方法可以通过一些参数调用 Visual Studio 来执行此操作,那也没关系.
Is there a tool to do this? I'd rather be able to do it in a machine without having Visual Studio installed. However, if there's a way to call Visual Studio with some parameters to do it, then that'll be fine too.
我简要地查看了 MSBuild,它看起来像是从我必须特别制作的 .proj 项目文件中工作,并且每次我将文件添加到 .vbproj 文件时都需要更新.(我确实简要地看过它,所以很可能我错过了一些重要的东西)
I looked briefly at MSBuild, and it looks like it works from a .proj project file that i'd have to make especially, and that I'd need to update every time I add a file to the .vbproj file. (I did look briefly at it, so it's very likely I missed something important)
任何帮助将不胜感激
推荐答案
MSBuild 是最简单的方法.例如:
MSBuild is the easiest way to go. For instance:
msbuild /property:Configuration=Release MyFile.vbproj
这篇关于在没有 Visual Studio 的情况下编译 .vbproj 或 .csproj 项目文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!