gpt4 book ai didi

c# - 构建 Visual Studio 项目时构建 SandcaSTLe 文档

转载 作者:太空狗 更新时间:2023-10-29 18:27:52 26 4
gpt4 key购买 nike

我正在使用 SandcaSTLe 帮助文件生成器将我的 C# XML-DOC 文件输出为网站格式。我如何从命令行完成同样的事情,以便在构建实际项目时将其添加为 Visual Studio 中的构建事件?

最终目标是在我构建 Visual Studio 项目时构建网站帮助文件内容。

最佳答案

正如 Scott Wylie 指出的那样,您需要在 Visual Studio 项目属性的生成后事件命令行中指定它。但是,我建议使用 Sandcastle Help File Builder (SHFB) 而不是直接使用 SandcaSTLe。它使命令行调用简短明了,如下所示,但请注意,首先您必须使用 SHFB GUI 配置 SHFB 项目,这会创建一个后缀为“.shfbproj”的 msbuild 兼容构建文件:

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe        /p:Configuration=Release myProject.shfbproj

However, note that I take the opposite approach from what you are doing: instead of using Visual Studio to interactively launch a build and ancillary actions, I use ant (nant) to launch a build of everything, which includes my Visual Studio solutions and subsequent SHFB action. So this is really the command-line call I make to build the documentation with Sandcastle:

<exec executable="${msbuild}" dir="${csharpdoc}" output="${csharpdoc.log}">
<arg value="/p:Configuration=Release"/>
<arg value="myProject.shfbproj"/>
</exec>

我的偏好是整个构建应该可以从命令行启动,因此不需要交互(例如启动 Visual Studio 等)。这提供了灵 active ,既可以作为计划的重复任务运行,也可以从 shell 按需运行。

关于c# - 构建 Visual Studio 项目时构建 SandcaSTLe 文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7882746/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com