.NET Core 3.1 or .NET 6?
-
We had .NET Core 3.1, then .NET 5 (which was the next version of .NET Core 3.1, skipping "4" so as not to confuse people with .NET 4.x, gee, thanks) and now we have .NET 6, aka .NET Core 6.
enum CoreVersion
{
DotNetCore31,
Net5,
Net6,
WhatsCore,
WhoCares
}var you = Programmer.Factory();
if (you.AreUsing(".NET") && you.AreUsing("Core"))
{
CoreVersion version = you.WhichDoYouUse();
Console.WriteLine(version);
}? How's that for a survey question? :laugh: One thing that is driving me nuts about .NET 6 is the null checks. Absurdly invasive. Yes, the whole null check madness can be disabled in the .csproj by setting
<Nullable>enable</Nullable>
to<Nullable>disable</Nullable>
At least we have that option, otherwise it's:#pragma warning disable CS8714 // The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.
#pragma warning disable CS8602 // Dereference of a possibly null reference.
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.And who knows how many other pragmas.
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and Services -
We had .NET Core 3.1, then .NET 5 (which was the next version of .NET Core 3.1, skipping "4" so as not to confuse people with .NET 4.x, gee, thanks) and now we have .NET 6, aka .NET Core 6.
enum CoreVersion
{
DotNetCore31,
Net5,
Net6,
WhatsCore,
WhoCares
}var you = Programmer.Factory();
if (you.AreUsing(".NET") && you.AreUsing("Core"))
{
CoreVersion version = you.WhichDoYouUse();
Console.WriteLine(version);
}? How's that for a survey question? :laugh: One thing that is driving me nuts about .NET 6 is the null checks. Absurdly invasive. Yes, the whole null check madness can be disabled in the .csproj by setting
<Nullable>enable</Nullable>
to<Nullable>disable</Nullable>
At least we have that option, otherwise it's:#pragma warning disable CS8714 // The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.
#pragma warning disable CS8602 // Dereference of a possibly null reference.
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.And who knows how many other pragmas.
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and ServicesYeah the whole "reference types are nullable" -> "reference types need to be made explicitly nullable" seems like a "oops, we didn't think of that" backtracking in philosophy. Or may the tech is simply at the point where the tooling can now help offset the inconvenience so it's no longer an inconveniece. I get what they are trying to achieve, but what I generally end up doing is just making my ref types nullable and then, later, checking whether they are null or not. Back to square 1. The static type checking and the errors if you don't do the null ref check are nice, though.
cheers Chris Maunder
-
We had .NET Core 3.1, then .NET 5 (which was the next version of .NET Core 3.1, skipping "4" so as not to confuse people with .NET 4.x, gee, thanks) and now we have .NET 6, aka .NET Core 6.
enum CoreVersion
{
DotNetCore31,
Net5,
Net6,
WhatsCore,
WhoCares
}var you = Programmer.Factory();
if (you.AreUsing(".NET") && you.AreUsing("Core"))
{
CoreVersion version = you.WhichDoYouUse();
Console.WriteLine(version);
}? How's that for a survey question? :laugh: One thing that is driving me nuts about .NET 6 is the null checks. Absurdly invasive. Yes, the whole null check madness can be disabled in the .csproj by setting
<Nullable>enable</Nullable>
to<Nullable>disable</Nullable>
At least we have that option, otherwise it's:#pragma warning disable CS8714 // The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.
#pragma warning disable CS8602 // Dereference of a possibly null reference.
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.And who knows how many other pragmas.
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and ServicesI dabbled with the nullable types when they were first introduced, but I have no real use for them. I actively avoid new "features" unless they provide a real benefit. Even Extension Methods are really just a "nice-to-have". Though I find Anonymous Methods to be very useful, particularly for making threads.
-
I dabbled with the nullable types when they were first introduced, but I have no real use for them. I actively avoid new "features" unless they provide a real benefit. Even Extension Methods are really just a "nice-to-have". Though I find Anonymous Methods to be very useful, particularly for making threads.
PIEBALDconsult wrote:
I dabbled with the nullable types when they were first introduced, but I have no real use for them.
I find nullable types really useful when the class is a model of the DB table schema, but otherwise agreed. I do like the idea of
string?
to properly reflect a column string type that is nullable.Latest Articles:
ASP.NET Core Web API: Plugin Controllers and Services -
We had .NET Core 3.1, then .NET 5 (which was the next version of .NET Core 3.1, skipping "4" so as not to confuse people with .NET 4.x, gee, thanks) and now we have .NET 6, aka .NET Core 6.
enum CoreVersion
{
DotNetCore31,
Net5,
Net6,
WhatsCore,
WhoCares
}var you = Programmer.Factory();
if (you.AreUsing(".NET") && you.AreUsing("Core"))
{
CoreVersion version = you.WhichDoYouUse();
Console.WriteLine(version);
}? How's that for a survey question? :laugh: One thing that is driving me nuts about .NET 6 is the null checks. Absurdly invasive. Yes, the whole null check madness can be disabled in the .csproj by setting
<Nullable>enable</Nullable>
to<Nullable>disable</Nullable>
At least we have that option, otherwise it's:#pragma warning disable CS8714 // The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.
#pragma warning disable CS8602 // Dereference of a possibly null reference.
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.And who knows how many other pragmas.
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and ServicesQuote:
.NET 6, aka .NET Core 6
I think they ended .NET Core line with .NET 5; bringing it all (Core, Standard, Framework, etc. etc.) together in a single platform. Personally, I'd like a .NET version that doesn't have a lifespan of 2-3 years only. I stopped caring about .NET versions, to be honest. :laugh:
The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~
-
We had .NET Core 3.1, then .NET 5 (which was the next version of .NET Core 3.1, skipping "4" so as not to confuse people with .NET 4.x, gee, thanks) and now we have .NET 6, aka .NET Core 6.
enum CoreVersion
{
DotNetCore31,
Net5,
Net6,
WhatsCore,
WhoCares
}var you = Programmer.Factory();
if (you.AreUsing(".NET") && you.AreUsing("Core"))
{
CoreVersion version = you.WhichDoYouUse();
Console.WriteLine(version);
}? How's that for a survey question? :laugh: One thing that is driving me nuts about .NET 6 is the null checks. Absurdly invasive. Yes, the whole null check madness can be disabled in the .csproj by setting
<Nullable>enable</Nullable>
to<Nullable>disable</Nullable>
At least we have that option, otherwise it's:#pragma warning disable CS8714 // The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.
#pragma warning disable CS8602 // Dereference of a possibly null reference.
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.And who knows how many other pragmas.
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and ServicesI like .NET6 Null checks are a fine way to prevent some silly error.. granted they might seem annoying occasionally, but you can then use the ! operator like so:
string s = null!;
, go ahead, try it! ;)A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!
-
PIEBALDconsult wrote:
I dabbled with the nullable types when they were first introduced, but I have no real use for them.
I find nullable types really useful when the class is a model of the DB table schema, but otherwise agreed. I do like the idea of
string?
to properly reflect a column string type that is nullable.Latest Articles:
ASP.NET Core Web API: Plugin Controllers and ServicesSystem.Data.SqlTypes.SqlString
-
We had .NET Core 3.1, then .NET 5 (which was the next version of .NET Core 3.1, skipping "4" so as not to confuse people with .NET 4.x, gee, thanks) and now we have .NET 6, aka .NET Core 6.
enum CoreVersion
{
DotNetCore31,
Net5,
Net6,
WhatsCore,
WhoCares
}var you = Programmer.Factory();
if (you.AreUsing(".NET") && you.AreUsing("Core"))
{
CoreVersion version = you.WhichDoYouUse();
Console.WriteLine(version);
}? How's that for a survey question? :laugh: One thing that is driving me nuts about .NET 6 is the null checks. Absurdly invasive. Yes, the whole null check madness can be disabled in the .csproj by setting
<Nullable>enable</Nullable>
to<Nullable>disable</Nullable>
At least we have that option, otherwise it's:#pragma warning disable CS8714 // The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.
#pragma warning disable CS8602 // Dereference of a possibly null reference.
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.And who knows how many other pragmas.
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and Services -
We had .NET Core 3.1, then .NET 5 (which was the next version of .NET Core 3.1, skipping "4" so as not to confuse people with .NET 4.x, gee, thanks) and now we have .NET 6, aka .NET Core 6.
enum CoreVersion
{
DotNetCore31,
Net5,
Net6,
WhatsCore,
WhoCares
}var you = Programmer.Factory();
if (you.AreUsing(".NET") && you.AreUsing("Core"))
{
CoreVersion version = you.WhichDoYouUse();
Console.WriteLine(version);
}? How's that for a survey question? :laugh: One thing that is driving me nuts about .NET 6 is the null checks. Absurdly invasive. Yes, the whole null check madness can be disabled in the .csproj by setting
<Nullable>enable</Nullable>
to<Nullable>disable</Nullable>
At least we have that option, otherwise it's:#pragma warning disable CS8714 // The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.
#pragma warning disable CS8602 // Dereference of a possibly null reference.
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.And who knows how many other pragmas.
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and ServicesFor those who are planning to upgrade to .NET 5 or newer, the folks at Inedo made a handy "Migration Scorecard" to find out if it is feasible: Tools for Estimating Your .NET 5 Migration[^] Our main application scored more than 90 points, very challenging. Inedo is known for their ProGet NuGet server, see: private-nuget-servers[^] And also the BuildMaster CI system: automated-deployment-services-for-net[^]
-
We had .NET Core 3.1, then .NET 5 (which was the next version of .NET Core 3.1, skipping "4" so as not to confuse people with .NET 4.x, gee, thanks) and now we have .NET 6, aka .NET Core 6.
enum CoreVersion
{
DotNetCore31,
Net5,
Net6,
WhatsCore,
WhoCares
}var you = Programmer.Factory();
if (you.AreUsing(".NET") && you.AreUsing("Core"))
{
CoreVersion version = you.WhichDoYouUse();
Console.WriteLine(version);
}? How's that for a survey question? :laugh: One thing that is driving me nuts about .NET 6 is the null checks. Absurdly invasive. Yes, the whole null check madness can be disabled in the .csproj by setting
<Nullable>enable</Nullable>
to<Nullable>disable</Nullable>
At least we have that option, otherwise it's:#pragma warning disable CS8714 // The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.
#pragma warning disable CS8602 // Dereference of a possibly null reference.
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.And who knows how many other pragmas.
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and ServicesI see no reason to keep using .net Core 3.1. .Net 6 is LTS, can be used with the same good old syntax and has wider compatibility with other OSes. Also, they fixed quite a few bugs in the runtime libraries - but I guess one could use the most recent NuGets with older runtime versions. We have both .net webforms (4.8) apps and razor (6.0) apps sharing the same logic libraries, so in those we use multitargeting and reference NetStandard where possible. If only MS made EF6 compatible with .net standard 2.1 we could get rid of multitargeting altogether (EF Core is not a valid alternative for our use cases). We are also exploring how to replace Windows-specific dependencies with portable ones, mostly because from our preliminary tests running unit tests under Linux seems to be much faster. One thing I really cannot stand: the new main syntax (Should the console project template use top-level statements · Issue #27420 · dotnet/docs · GitHub[^]). Maybe I'm just getting old :)
Luca The Price of Freedom is Eternal Vigilance. -- Wing Commander IV En Það Besta Sem Guð Hefur Skapað, Er Nýr Dagur. (But the best thing God has created, is a New Day.) -- Sigur Ròs - Viðrar vel til loftárása
-
For those who are planning to upgrade to .NET 5 or newer, the folks at Inedo made a handy "Migration Scorecard" to find out if it is feasible: Tools for Estimating Your .NET 5 Migration[^] Our main application scored more than 90 points, very challenging. Inedo is known for their ProGet NuGet server, see: private-nuget-servers[^] And also the BuildMaster CI system: automated-deployment-services-for-net[^]
Well, I'm definitely not doing upgrades - my curiosity is for new personal projects. I've been using .NET Core 3.1 and have been recently poking at .NET 6. So far so good, but again, these are greenfield projects, not upgrades.
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and Services -
I see no reason to keep using .net Core 3.1. .Net 6 is LTS, can be used with the same good old syntax and has wider compatibility with other OSes. Also, they fixed quite a few bugs in the runtime libraries - but I guess one could use the most recent NuGets with older runtime versions. We have both .net webforms (4.8) apps and razor (6.0) apps sharing the same logic libraries, so in those we use multitargeting and reference NetStandard where possible. If only MS made EF6 compatible with .net standard 2.1 we could get rid of multitargeting altogether (EF Core is not a valid alternative for our use cases). We are also exploring how to replace Windows-specific dependencies with portable ones, mostly because from our preliminary tests running unit tests under Linux seems to be much faster. One thing I really cannot stand: the new main syntax (Should the console project template use top-level statements · Issue #27420 · dotnet/docs · GitHub[^]). Maybe I'm just getting old :)
Luca The Price of Freedom is Eternal Vigilance. -- Wing Commander IV En Það Besta Sem Guð Hefur Skapað, Er Nýr Dagur. (But the best thing God has created, is a New Day.) -- Sigur Ròs - Viðrar vel til loftárása
Luca Leonardo Scorcia wrote:
One thing I really cannot stand: the new main syntax
It sure takes a bit getting used to, at least visually. I was quite taken aback when I started with a .NET 6 Web API template. Where's Startup.cs? WTF is going on in Program.cs? Once I realized what happened, my brain started to slowly adjust -- but it's still adjusting.
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and Services -
We had .NET Core 3.1, then .NET 5 (which was the next version of .NET Core 3.1, skipping "4" so as not to confuse people with .NET 4.x, gee, thanks) and now we have .NET 6, aka .NET Core 6.
enum CoreVersion
{
DotNetCore31,
Net5,
Net6,
WhatsCore,
WhoCares
}var you = Programmer.Factory();
if (you.AreUsing(".NET") && you.AreUsing("Core"))
{
CoreVersion version = you.WhichDoYouUse();
Console.WriteLine(version);
}? How's that for a survey question? :laugh: One thing that is driving me nuts about .NET 6 is the null checks. Absurdly invasive. Yes, the whole null check madness can be disabled in the .csproj by setting
<Nullable>enable</Nullable>
to<Nullable>disable</Nullable>
At least we have that option, otherwise it's:#pragma warning disable CS8714 // The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.
#pragma warning disable CS8602 // Dereference of a possibly null reference.
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.And who knows how many other pragmas.
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and ServicesMy personal motto is not to stick to previous versions unless there's a REALLY good reason to use them. To name an example, .NET source generators still require a .NET standard project, so I'm running mine on .NET standard instead of upgrading it to .NET 6. The null checks are great! I've enabled them in .NET 5 (where they were optional) and am very glad they're enabled by default now. Having the null as a conscious & explicit construct, rather than something which just happens & is kept implicit, is a huge boon for safety! Knowing for sure that a string parameter (as opposed to a string? parameter) will not be null (and it it is, I'll get an exception way before control flow forks into this particular method) helps a lot! I also came to use null explicitly if I want an erroneous value which doesn't warrant an exception. When, an example I often work with, parsing a protocol with optional fields, I initialize those fields to null in the output structure. Knowing that the only way for a null to get there is for my parser to put it there because null is explicit.
-
We had .NET Core 3.1, then .NET 5 (which was the next version of .NET Core 3.1, skipping "4" so as not to confuse people with .NET 4.x, gee, thanks) and now we have .NET 6, aka .NET Core 6.
enum CoreVersion
{
DotNetCore31,
Net5,
Net6,
WhatsCore,
WhoCares
}var you = Programmer.Factory();
if (you.AreUsing(".NET") && you.AreUsing("Core"))
{
CoreVersion version = you.WhichDoYouUse();
Console.WriteLine(version);
}? How's that for a survey question? :laugh: One thing that is driving me nuts about .NET 6 is the null checks. Absurdly invasive. Yes, the whole null check madness can be disabled in the .csproj by setting
<Nullable>enable</Nullable>
to<Nullable>disable</Nullable>
At least we have that option, otherwise it's:#pragma warning disable CS8714 // The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.
#pragma warning disable CS8602 // Dereference of a possibly null reference.
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.And who knows how many other pragmas.
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and ServicesWe make extensive use of SQL Server Reporting Services. After waiting over five years for Microsoft to provide .NET Core / 5 / 6 / ... support for it, they finally announced "the plan for reporting" last month: How to Integrate Power BI Reporting into .NET apps | Microsoft Power BI Blog | Microsoft Power BI[^] Migrate SQL Server Reporting Services reports to Power BI - Power BI | Microsoft Docs[^] Step 1: Verify that your organization has a Power BI Premium subscription. No thanks. We've already paid for the Windows Server license, and paid for the SQL Server license. We're not going to pay even more just to display reports in .NET which we can already display in .NET Framework for "free". :wtf: Looks like we'll be sticking with .NET Framework 4.8 for as long as we can.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Quote:
.NET 6, aka .NET Core 6
I think they ended .NET Core line with .NET 5; bringing it all (Core, Standard, Framework, etc. etc.) together in a single platform. Personally, I'd like a .NET version that doesn't have a lifespan of 2-3 years only. I stopped caring about .NET versions, to be honest. :laugh:
The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~
They ended the core branding with .NET 5; but .NET 5 is still .net core; not .net framework.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius