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
<PackageReference Include="VDimensions.MSBuild.Sdk.Defaults" Version="0.8.35"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="VDimensions.MSBuild.Sdk.Defaults" Version="0.8.35" />
<PackageReference Include="VDimensions.MSBuild.Sdk.Defaults"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add VDimensions.MSBuild.Sdk.Defaults --version 0.8.35
#r "nuget: VDimensions.MSBuild.Sdk.Defaults, 0.8.35"
#:package VDimensions.MSBuild.Sdk.Defaults@0.8.35
#addin nuget:?package=VDimensions.MSBuild.Sdk.Defaults&version=0.8.35
#tool nuget:?package=VDimensions.MSBuild.Sdk.Defaults&version=0.8.35
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
- Wrap
unsafecode in#if UNSAFE/#endifpreprocessor directives - Reference the
VDimensions.MSBuild.Sdk.Defaultsnuget 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.
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 |