Is there a standard file extension for MSBuild files?

Is there a standard file extension for MSBuild files that are not project files, but is it harder to build scripts instead?

I thought .msbuild.proj to avoid confusion with other .proj files (which, as I know, are MSBuild files).

+63
msbuild
Jan 05 '10 at
source share
4 answers

UPDATE:. In retrospect, I updated the answer to include more conventions. The loan goes to Sayed Ibrahim Hashimi and others in this thread.




.proj

Popular agreement for general use. Commonly used by the main build script.

Examples:

 build.proj main.proj company.product.build.proj 



.targets

.targets files are those that are intended to be imported into other files using the Import element. Since these files are strictly processed, they actually build nothing. Usually they do not have the properties and values โ€‹โ€‹of the elements to actually create something.

Examples:

 Microsoft.Common.targets Microsoft.CSharp.targets Microsoft.Data.Entity.targets 



.**proj

The language convention, where **** represents the abbreviation of the language.

Known extensions:

 .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

The project properties page used by Visual C ++ projects ( .vcxproj ).

Examples:

 Microsoft.Cl.Common.props Microsoft.Cpp.CoreWin.props Microsoft.Cpp.props Microsoft.Link.Common.props 



.tasks

A generic include file that must be imported by the calling MSBuild project. Contains a list of <UsingTask> elements.

Examples:

 Microsoft.Common.Tasks MSBuild.ExtensionPack.tasks 



.settings.targets

(This is a related convention, if not strictly speaking, a file extension.)

A generic include file that must be imported by the calling MSBuild project. It contains "various properties related to the common utilities used during the build and deployment process, as well as any other general settings" ( Sayed Ibrahim Hashimi, 2009 ).

Examples:

EntityFramework.settings.targets

Compiler.settings.targets

Library.Settings.targets

+75
Jan 06 '10 at 10:27
source share

Closest to the standard is the following:

  • .proj
  • .targets
  • . XXproj

.targets are those designed to be imported into other files using the Import element . Since these files are strictly processed, they actually build nothing. Usually they do not have the properties and values โ€‹โ€‹of the elements to actually create something.

.proj files are created by files that can be created on their own. They can import .targets files.

.XXproj , for example .csproj or .vbproj, are files that create files containing a specific language. For example .csproj for C # projects and .vbproj for VB.NET project files. This convention comes from Visual Studio.

+14
Jan 07 2018-01-10T00: 00Z
source share

We just use .build

+4
Jan 05 '10 at 17:21
source share

I recommend what VS does:

 .*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. 
+2
Jul 18 2018-11-11T00:
source share



All Articles