RickStrahl / Westwind.Utilities

A general purpose utility and helper library for .NET development
MIT License
256 stars 61 forks source link

DefineConstants values in Westwind.Utilities.csproj #11

Closed granadacoder closed 4 years ago

granadacoder commented 4 years ago

In

https://github.com/RickStrahl/Westwind.Utilities/blob/master/Westwind.Utilities/Westwind.Utilities.csproj

<TargetFrameworks>netstandard2.0;net46;net40</TargetFrameworks>

So we have net46 in the list.

And later on we have the below.

  <PropertyGroup Condition=" '$(TargetFramework)' == 'net46'">
    <DefineConstants>NET45;NETFULL</DefineConstants>
  </PropertyGroup>

The "constant" NET45.

Is that a typo (copy/paste error)? Or on purpose?

Should it be (the below)?

<DefineConstants>NET46;NETFULL</DefineConstants>

I'm probably over thinking it (and its a mild typo and should be NET46)...

But I've having Net20, Net30, and Net35 "flashbacks" when 3.0 and 3.5 built on top of 2.0.

Thanks for all your blogs! I learn something new and stay updated with many of your articles.

RickStrahl commented 4 years ago

These are 'generic' values to identify runtime features. Although we're using .NET 4.6.2 and later then define constants value is meant to differentiate between net40 and net45+ feature support - mainly Async support.

It's probably better to refactor this to use #if !NET40 at this point, and might make for some refactoring to make this less ambiguous but not that important.

The values are used internally only so they don't affect anything outside of the framework.

Thank you.