是否有标准的文件扩展名用于不是项目文件而是更复杂的构建脚本的MSBuild文件?
我考虑使用 .msbuild.proj 来避免与其他 .proj 文件混淆(我知道实际上它们也是 MSBuild 文件)。
是否有标准的文件扩展名用于不是项目文件而是更复杂的构建脚本的MSBuild文件?
我考虑使用 .msbuild.proj 来避免与其他 .proj 文件混淆(我知道实际上它们也是 MSBuild 文件)。
更新: 回顾过去,我已经更新了答案以包括更多的约定。 感谢Sayed Ibrahim Hashimi和这个线程中的其他人。
.proj
这是一种通用的约定,常用于主构建脚本。
示例:
build.proj
main.proj
company.product.build.proj
.targets
.targets
文件是指那些可以通过导入元素导入到其他文件中的文件。由于这些文件严格可重用,它们实际上并不构建任何东西。通常缺少属性和项目值来实际构建任何内容。
示例:
Microsoft.Common.targets
Microsoft.CSharp.targets
Microsoft.Data.Entity.targets
.**proj
这是一种特定编程语言的命名约定,其中****代表该语言的简称。
常见的扩展名包括:
.csproj | C#
.vbproj | VB.NET
.vcxproj | Visual C++
.dbproj | Database project
.fsproj | F#
.pyproj | IronPython
.rbproj | IronRuby
.wixproj | Windows Installer XML (WiX)
.vdproj | Visual Studio Deployment Project
.isproj | InstallShield
.pssproj | PowerShell
.modelproj | Modeling project
.props
Visual C++项目(.vcxproj
)使用的项目属性表。
示例:
Microsoft.Cl.Common.props
Microsoft.Cpp.CoreWin.props
Microsoft.Cpp.props
Microsoft.Link.Common.props
.tasks
这是一个常见的包含文件,被调用的MSBuild项目导入。包含一系列<UsingTask>
元素的列表。
示例:
Microsoft.Common.Tasks
MSBuild.ExtensionPack.tasks
.settings.targets
(严格来说,这不是文件扩展名,而是一个相关的约定。)
这是一个常见的包含文件,由调用MSBuild项目导入。它包含与构建和部署过程中使用的共享工具以及任何其他常见设置相关的各种属性。(Sayed Ibrahim Hashimi, 2009)
示例:
<import Project="MyProject.settings.targets" />
,那么我会在该行后面跟着一个<Import Project="MyProject.settings.targets.user" Condition="Exists('MyProject.settings.targets.user')" />
。这样,如果我需要为本地机器覆盖任何内容但不想将其放在源代码控制中,我可以将其放在那里。 - DotNetSparky最接近标准的格式如下:
.targets 文件是指在其他文件中使用 Import 元素 导入的文件。由于这些文件严格可重用,它们本身不会构建任何内容。通常缺少实际构建所需的属性和项值。
.proj 文件是可以单独构建的已创建文件。它们可以导入 .targets 文件。
.XXproj, 例如 .csproj 或 .vbproj 是构建包含特定语言的文件的文件。例如,.csproj 用于 C# 项目,而 .vbproj 用于 VB.NET 项目文件。此约定来自 Visual Studio。
.build
。*.工程
来刁难那些没有正确 Unicode 支持的工具。 - JDługosz.*proj for project files --- msbuild.exe will find them automatically if they match this pattern
.targets for build process --- generally imported towards the end of your project
.props for shared settings --- generally imported towards the top of your project. C++ (*.vcxproj) files use these, and they will doubtless get added to VB and C# default project files at some point.