.Net Core

Background

Wanted to shed new lights on my experience trying to compile a third party utility.

Lineage

  1. Visual Studio – Build – Error “NETSDK1045: The current .NET SDK does not support targeting .NET Standard 2.1. Either target .NET Standard 2.0 or lower, or use a version of the .NET SDK that supports .NET Standard 2.1.”
    Link

Error Messages

Here are the error messages :-

  1. C:\Program Files\dotnet\sdk\2.1.507\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(150,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Standard 2.1. Either target .NET Standard 2.0 or lower, or use a version of the .NET SDK that supports .NET Standard 2.1. [app.csproj]
  2. C:\Program Files\dotnet\sdk\2.1.507\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(150,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Standard 2.1. Either target .NET Standard 2.0 or lower, or use a version of the .NET SDK that supports .NET Standard 2.1. [src\Extensions\SerilogAdapter\SerilogAdapter.csproj]
  3. C:\Program Files\dotnet\sdk\2.1.507\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(150,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Standard 2.1. Either target .NET Standard 2.0 or lower, or use a version of the .NET SDK that supports .NET Standard 2.1. [src\Extensions\MicrosoftLoggingAdapter\MicrosoftLoggingAdapter.csproj]
  4. C:\Program Files\dotnet\sdk\2.1.507\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.0. [technologyTests.csproj]
  5. C:\Program Files\dotnet\sdk\2.1.507\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.0. [SerilogAdapterTests\SerilogAdapterTests.csproj]
  6. C:\Program Files\dotnet\sdk\2.1.507\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(150,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Standard 2.1. Either target .NET Standard 2.0 or lower, or use a version of the .NET SDK that supports .NET Standard 2.1. [src\Extensions\NLogAdapter\NLogAdapter.csproj]
  7. C:\Program Files\dotnet\sdk\2.1.507\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.0. [src\Extensions\AspNetCore\AspNetCore.csproj]
  8. error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.0. [tests\MicrosoftLoggingAdapterTests\MicrosoftLoggingAdapterTests.csproj]
  9. error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.0. [NLogAdapterTests\NLogAdapterTests.csproj]

TroubleShooting

.NET Core 3.0

Referenced Entries

One of the referenced entries is .Net Core 3.0

Project Files

To detect whether a .Net Solution needs .Net Core, please review the project’s solution file, make a list of each referenced project, and review the accompany project file.

Sample

Extensions\AspNetCore

The solution I was evaluating relies on the AspNetCore.

I accessed the ASPNet and reviewed it’s target framework.

Image

aspnetcore.csproj

Textual

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <OutputType>Library</OutputType>
  </PropertyGroup>

  <PropertyGroup>
    <RootNamespace>Microsoft.Extensions.DependencyInjection</RootNamespace>

Explanation
  1. Target Framework
    • netcoreapp3.0

.Net Core

What is .Net Core?

One of the more succinct definitions on what .Net Core is available here :-

About .Net Core
Link

Characteristics

.NET Core has the following characteristics:

  1. Cross-platform: Runs on Windows, macOS, and Linux operating systems.
  2. Consistent across architectures: Runs your code with the same behavior on multiple architectures, including x64, x86, and ARM.
  3. Command-line tools: Includes easy-to-use command-line tools that can be used for local development and in continuous-integration scenarios.
  4. Compatible: .NET Core is compatible with .NET Framework, Xamarin, and Mono, via .NET Standard.
  5. Open source: The .NET Core platform is open source, using MIT and Apache 2 licenses.
  6. .NET Core is a .NET Foundation project.
  7. Supported by Microsoft: .NET Core is supported by Microsoft, per .NET Core Support.

Components

  1. .Net Core Runtime & Framework
    • The .NET Core runtime, which provides a type system, assembly loading, a garbage collector, native interop, and other basic services.
    • .NET Core framework libraries provide primitive data types, app composition types, and fundamental utilities.
  2. ASP.NET Core runtime
    • The ASP.NET Core runtime, which provides a framework for building modern cloud-based internet connected applications, such as web apps, IoT apps, and mobile backends.
  3. .Net Core SDK
    • The .NET Core SDK and language compilers (Roslyn and F#) that enable the .NET Core developer experience.
  4. dotnet Command
    • The dotnet command, which is used to launch .NET Core apps and CLI commands.
    • It selects the runtime and hosts the runtime, provides an assembly loading policy, and launches apps and tools.

Distribution

These components are distributed in the following ways:

  1. .NET Core Runtime
    • Includes the .NET Core runtime and framework libraries.
  2. ASP.NET Core Runtime
    • Includes ASP.NET Core and .NET Core runtime and framework libraries.
  3. .NET Core SDK
    • Includes the .NET Core CLI, ASP.NET Core runtime, and .NET Core runtime and framework.

Artifacts

  1. .Net

Remediation

I downloaded and installed the latest .Net Core Framework and runtime.

.Net core framework for development and .net core runtime for running the application.

Summary

In short summary, error messages are there for a reason.

Don’t overlook them.

Don’t short circuit them.

They are there for a reason.

And, in some cases they open you up to new challenges and opportunities.

References

  1. .Net Core
    • Download .Net Core
      Link

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s