VDimensions.MSBuild.Sdk.Defaults 0.8.35

dotnet add package VDimensions.MSBuild.Sdk.Defaults --version 0.8.35
                    
NuGet\Install-Package VDimensions.MSBuild.Sdk.Defaults -Version 0.8.35
                    
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="VDimensions.MSBuild.Sdk.Defaults" Version="0.8.35">
  <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="VDimensions.MSBuild.Sdk.Defaults" Version="0.8.35" />
                    
Directory.Packages.props
<PackageReference Include="VDimensions.MSBuild.Sdk.Defaults">
  <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 VDimensions.MSBuild.Sdk.Defaults --version 0.8.35
                    
#r "nuget: VDimensions.MSBuild.Sdk.Defaults, 0.8.35"
                    
#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 VDimensions.MSBuild.Sdk.Defaults@0.8.35
                    
#: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=VDimensions.MSBuild.Sdk.Defaults&version=0.8.35
                    
Install as a Cake Addin
#tool nuget:?package=VDimensions.MSBuild.Sdk.Defaults&version=0.8.35
                    
Install as a Cake Tool

VDimensions.MSBuild.Sdk.Defaults

Introduces various defaults to MSBuild properties that are often unset originally. The defaults are described in the table below:

Property Default Value Condition
Configuration Debug is not set
Platform AnyCPU is not set
PlatformTarget AnyCPU is not set
OutputPath bin\$(Configuration) is not set
RootNamespace $(AssemblyName) is not set and $(AssemblyName) != ''
AssemblyVersion $(Version) is not set and $(Version) != ''
AssemblyFileVersion $(Version) is not set and $(Version) != ''
AssemblyInformationalVersion $(Version) is not set and $(Version) != ''
PackageVersion $(Version) is not set and $(Version) != ''

Improved support of UNSAFE blocks trough MSBuild

I addition, the current package defines the UNSAFE preprocessor directive automatically in case the AllowUnsafeBlocks setting is enabled for the importing project.

This allows a developer to conditionally acivate unsafe code based on whether the assembly itself is marked unsafe, without issuing compile-time errors.

How to use

  1. Wrap unsafe code in #if UNSAFE/#endif preprocessor directives
  2. Reference the VDimensions.MSBuild.Sdk.Defaults nuget package in your project.

How this works

MSBuild does not set AllowUnsafeBlocks by default. As a result, the UNSAFE symbol will not be added to the DefineConstants property, and any code inside an #if UNSAFE/#endif block will be skipped by the compiler for that particular platform. The unsafe keyword will no longer issue a compile-time error.

When a developer needs to compile the assembly with unsafe code, for example, by using the unsafe compiler switch, the AllowUnsafeBlocks MSBuild property will be defined by the compiler. In turn, this will enable the UNSAFE preprocessor directive, and any code wrapped in #if UNSAFE/#endif will be compiled.

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.8.35 75 9/15/2026
0.8.33 73 9/15/2026
0.7.30 90 9/10/2026
0.7.26 98 9/7/2026
0.7.7 316 4/11/2026
0.7.6 287 4/11/2026
0.7.5 288 4/11/2026
0.6.12 953 2/26/2023
0.6.11 865 12/29/2022
0.6.10 835 11/9/2022
0.6.9 848 11/9/2022
0.6.8 822 11/9/2022
0.6.7 895 10/18/2022
0.6.6 906 10/18/2022
0.6.3 1,105 5/4/2021
0.6.2 830 5/3/2021
0.6.1 848 5/3/2021
0.6.0 826 5/3/2021
Loading failed