Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

MSBuild File Extensions Explained: .proj, .targets, .props, .tasks, and *proj Types

Originally published on 2016-07-02; fully revised and updated.

MSBuild separates build logic into different file types so teams can reuse settings, tasks, and targets across many projects. If you work with .NET builds, this guide clarifies the role of each extension, shows how imports are typically layered, and provides practical examples you can adapt. This revision is based on the original post.

Extensions used in .NET and MSBuild projects

What each MSBuild-related extension is for

Extension or patternPrimary purposeTypical usageExample
.projTop-level or orchestrator build projectCalls targets, imports shared files, coordinates multi-project buildsbuild.proj, main.proj
.targetsReusable target definitionsImported into other projects; usually provides build steps, not full standalone buildsMicrosoft.Common.targets
.propsShared properties and defaultsImported early to set common values used later in evaluationMicrosoft.Cpp.props
.tasksTask registration includesContains UsingTask declarations for custom tasksMSBuild.ExtensionPack.tasks
.settings.targetsTeam naming convention for shared settingsImported file for common build and deployment settingsEntityFramework.settings.targets
*projLanguage or project-type fileMain project definition consumed by MSBuild tooling.csproj, .vbproj, .vcxproj

Language-specific project extensions from the original reference

The original article also listed these project-type extensions. They identify the language or tooling ecosystem around a project file.

ExtensionProject type
.csprojC#
.vbprojVB.NET
.vcxprojVisual C++
.dbprojDatabase project
.fsprojF#
.pyprojIronPython
.rbprojIronRuby
.wixprojWindows Installer XML (WiX)
.vdprojVisual Studio Deployment Project
.isprojInstallShield
.pssprojPowerShell
.modelprojModeling project

How these files typically work together

Import order and file responsibility are the core ideas: shared properties are usually loaded early, reusable targets and tasks are imported where needed, and the entry project triggers execution.

flowchart LR
    A[Start build command] --> B[Load entry project file]
    B --> C[Import shared props]
    C --> D[Evaluate properties and items]
    D --> E[Import tasks and targets]
    E --> F[Execute requested target]
    F --> G[Compile package deploy]

Practical examples

Example: orchestrator .proj file that imports shared configuration and runs a project build.

<Project DefaultTargets='Build' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
  <Import Project='build/common.props' />
  <Import Project='build/common.tasks' />

  <Target Name='Build'>
    <MSBuild Projects='src/MyApp/MyApp.csproj'
             Targets='Build'
             Properties='Configuration=Release' />
  </Target>

  <Import Project='build/common.targets' />
</Project>Code language: HTML, XML (xml)

Example: reusable .targets file.

<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
  <Target Name='PrintBuildInfo' BeforeTargets='Build'>
    <Message Text='Building $(MSBuildProjectName) in $(Configuration)'
             Importance='high' />
  </Target>
</Project>Code language: HTML, XML (xml)

Example: .tasks include containing task registrations.

<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
  <UsingTask TaskName='Company.Build.ZipDirectory'
             AssemblyFile='tools/Company.Build.Tasks.dll' />
</Project>Code language: HTML, XML (xml)

Common commands:

msbuild build.proj /t:Build /p:Configuration=Release
dotnet build src/MyApp/MyApp.csproj -c Release

About the .settings.targets convention

.settings.targets is a naming convention, not a special parser rule in MSBuild. In the original post, it is attributed to Sayed Ibrahim Hashimi (2009) as a way to centralize shared utility and deployment-related properties.

Best practices

  • Keep .proj files focused on orchestration, not deep reusable logic.
  • Put reusable defaults in .props and reusable build actions in .targets.
  • Use .tasks (or equivalent imported files) to isolate custom task registration.
  • Standardize naming so teams can quickly identify purpose from filename alone.
  • Document import order explicitly, because MSBuild behavior is strongly order-dependent.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

MSBuild for Beginners: Project File Fundamentals, Build Flow, and Practical Commands

Learn how MSBuild project files are structured, how targets and tasks execute, and which commands are most useful in CI/CD. This revised guide also preserves the original learning links from the post.

Read More

MSBuild Quick Start for DevOps: Projects, Targets, Tasks, and CLI Builds

Learn how MSBuild works from the inside out, including projects, properties, items, targets, and tasks. This revised guide adds a build workflow diagram, command examples, and practical usage patterns for automation.

Read More

Running MSBuild 4.0 and 3.5 Side by Side on Legacy CruiseControl.NET CI

If your CI server started failing after projects were upgraded to Visual Studio 2010, the usual cause is that jobs still invoke MSBuild 3.5. This guide shows a legacy-compatible fix: install .NET 4.0, copy required MSBuild targets, and update ccnet.config while keeping 3.5 builds available.

Read More

Introduction of MSbuild

By Rambabu Muppuri 2810 days ago Comments (3) can u pl help me anyone introduction of msbuild? Hi Guys, can u pl help me anyone Introduction of MSbuild? Regards, Rambabu.M…

Read More

Msbuild slower than devenv

scmuser created the topic: msbuild slower than devenv Hi, I’m experiencing performance inconsistencies with regards to build duration when building a VS2008 solution file with either devenv…

Read More

MSBuild Tool

rambabu1683 created the topic: MSBuild Tool Hi guys, i am new to this forum. can anyone help me about MSBUILD tool with small examples? Warm Regards, Rambabu.M…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x