YellowDogMan.Elements.Style 0.1.5

Prefix Reserved
dotnet add package YellowDogMan.Elements.Style --version 0.1.5
                    
NuGet\Install-Package YellowDogMan.Elements.Style -Version 0.1.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="YellowDogMan.Elements.Style" Version="0.1.5">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="YellowDogMan.Elements.Style" Version="0.1.5" />
                    
Directory.Packages.props
<PackageReference Include="YellowDogMan.Elements.Style">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add YellowDogMan.Elements.Style --version 0.1.5
                    
#r "nuget: YellowDogMan.Elements.Style, 0.1.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package YellowDogMan.Elements.Style@0.1.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=YellowDogMan.Elements.Style&version=0.1.5
                    
Install as a Cake Addin
#tool nuget:?package=YellowDogMan.Elements.Style&version=0.1.5
                    
Install as a Cake Tool

Elements.Style (WIP)

Aims to be, shared code style/project configuration for Yellow Dog Man Studios(YDMS) Projects.

As YDMS increases the amount of Open Source Software it produces, the question of Code Style continues to emerge. This repo will be an answer to that question.

Goals

  • Sharable & Synced Code Style rules for YDMS .NET Projects
  • Discussion/Issue Hub for YDMS Code Style
  • Low Effort - Each project should be able to include this easily
  • Synchronized - We don't need to manually copy files around
  • Versioned - new warnings/code style items do not suddenly appear

Setup

To use Elements.Style in your project:

  1. Add it as a PackageReference to your project:
<PackageReference Include="YellowDogMan.Elements.Style" Version="0.1.0" />
  1. Create or edit a Directory.build.props file in the root of your Repository, Inside ensure the RepositoryRoot property is specified:
<Project>
  <PropertyGroup>
    <RepositoryRoot><Repository Root></RepositoryRoot>
  </PropertyGroup>
</Project>

And populated with your Repository root. Common values for this can be found:

  • By using <SolutionDir> as in: <RepositoryRoot>$(SolutionDir)</RepositoryRoot>
  • By using $(MSBuildThisFileDirectory) as in: <RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>

We've made some automation to try and do this for you, but it might not work correctly. See https://github.com/Yellow-Dog-Man/Elements.Style/issues/4 for more information

  1. Build your project, it'll copy relevant files to their correct location.

Commit Changes

As this project, copies build and style files to their appropriate location within your project. It is important to commit the changes if they change.

This ensures that, web based tools such as GitHub also have the latest files.

Versioning

As Elements.Style is a regular NuGet Package, we use its versions to roll out new or enhanced code style changes to new projects. Using versioning also ensures that you only need to apply new styles when you're ready, stay on an older version and you'll skip the new rules.

Eventually, we'll instruct Dependabot to start automatically bumping this Package across our repositories though.

Components

NuGet

This project produces a NuGet package called/ with an id of: YellowDogMan.Elements.Style.

.editorconfig

A shared collection of rules and settings for various file types. Full documentation is available on the editor config website

Uses RehanSaeed's Editor Config as a base.

Style & Config Synchronization

By packing a .props and .targets file in buildTransitive folder, that have the same name as the package name, we get some cool properties:

  1. The .targets within the Targets file will run
  2. The .props within the Props file will be included.

These items when combined, allow us to place style rules etc within your project.

Testing Locally

Elements.Style.Test exists purely as a test project to test Elements.Style. To test new versions locally:

  1. cd into Elements.Style
  2. dotnet pack -c Release -p:Version=0.0.1-local.<x> where x is a version number
  3. Update the <PackageReference> in Elements.Style.Test.csproj with the new number.

References & Resources

Style Rules

MSBuild

Packing and Distribution of .NET Props and Code Style

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.5 130 8/28/2026
0.1.4 162 8/6/2026
0.1.1 153 8/4/2026
0.1.0 149 8/4/2026