Dotnet-ef tool backwards compatibility? - .net-core

If I update the dotnet-ef tool from 3.1.8 to 5.0.1, will this still work with 3.1 projects? If I use 5.0.1 it would still produce the same schemas as 3.1.8 for 3.1 projects?
Or should I be using the dotnet tool manifest for my 3.1 projects to specify the 3.1 tools?

I asked to Microsoft, below the response:
Yes, the tool is backwards compatible; it's a thin wrapper. I would
always update to the latest version. Note, however, that 2.2 is
out-of-support.

Related

How does the .NET Installer task chooses which version to install?

I have created a test pipeline with a .NET Core Installer task like this:
Running the task today (2019-11-22), it installs v2.2.402:
##[section]Starting: Use .Net Core sdk 2.2.x
==============================================================================
Task : Use .NET Core
Description : Acquires a specific version of the .NET Core SDK from the internet or the local cache and adds it to the PATH. Use this task to change the version of .NET Core used in subsequent tasks. Additionally provides proxy support.
Version : 2.0.24
Author : Microsoft Corporation
Help : https://aka.ms/AA4xgy0
==============================================================================
Tool to install: .NET Core sdk version 2.2.x.
Found version 2.2.402 in channel 2.2 for user specified version spec: 2.2.x
Version: 2.2.402 was found in cache.
Creating global tool path and pre-pending to PATH.
##[section]Finishing: Use .Net Core sdk 2.2.x
According to the Download .NET Core 2.2 page, SDKs 2.2.402, 2.2.206 and 2.2.109 (runtime v2.2.7) were released on September 10th 2019:
But SDKs 2.2.207 and 2.2.110 (runtime v2.2.8) were released on November 19th 2019:
So, acccording to the documentation of the .NET Core Installer task, versions can be given in the following formats:
2.x => Install latest in major version.
2.2.x => Install latest in major and minor version
2.2.104 => Install exact version
Why was v2.2.402 installed? What is the criteria used for choosing the version of the SDK to install when using wildcards such as 2.2.x or 2.1.x?
The version in Use .Net Core task or .Net Core Installer task are picked using semantic versioning 2.0.
Hence, the highest version number is picked which in case of 2.2.207 and 2.2.402 is 2.2.402
Why was v2.2.402 installed? What is the criteria used for choosing the version of the SDK to install when using wildcards such as 2.2.x or 2.1.x?
Sorry for this late reply, but still hope it can give you any help
This is a known issue on Github:
.NET Core November Update - 2.1.14, 2.2.8, and 3.0.1
IanKemp commented:
2.2.7 contained SDK 2.2.402 for VS 2019 v16.2, but this release has no SDK for 16.2 only for 16.0. Does that mean SDK 2.2.402 is the latest
and that if we already have it, we don't need SDK 2.2.207 from 2.2.8
Compare the release note v2.2.8 and v2.2.7:
So, the latest SDK version does not support the latest Visual Studio version, that may the reason why we still get the version v2.2.402 by that task.
The version that supports 16.2 should be released soon. By then we can use this task to get version 2.2.207.
Hope this helps.

The current .NET SDK does not support targeting .NET Core 3.0 | 3.1 | 5.0 | 6.0

I've just downloaded the release version of .NET Core 3.0.100
It was installed alongside older version that I have:
When I try to run dotnet restore for a project that targets .NET Core 3 (<TargetFramework>netcoreapp3.0</TargetFramework>), I get this error
C:\Program Files\dotnet\sdk\2.2.202\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.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.0.
I have a global.json file that explicitly states that I need the 3.0.100 SDK
{
"sdk": {
"version": "3.0.100"
}
}
I know that I can edit the MSBuildSDKsPath env variable to point to the 3.0.100 SDK, and it works, but I don't want to do it, I have other projects on my machine that still need to use older versions of .NET Core.
Is there a way to make the dotnet tool use the SDK that's stated in global.json instead of the one in MSBuildSDKsPath?
Edit: I use Visual Studio Code
You also have to update your visual studio to the minimum supported version:
.NET Core 3.0
minimum visual studio v16.3
.NET Core 3.1
minimum visual studio v16.5
.NET Core 5.0
minimum visual studio v16.6 latest preview
.NET Core 6.0
minimum visual studio v17.0 latest preview
(https://dotnet.microsoft.com/download/dotnet-core/3.0)
(https://dotnet.microsoft.com/download/dotnet-core/3.1)
(https://dotnet.microsoft.com/download/dotnet/5.0)
(https://dotnet.microsoft.com/download/dotnet/6.0)
I got this error in Azure DevOps with .NET 6:
error NETSDK1045: The current .NET SDK does not support targeting .NET
6.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0.
Solved by including the SDK like this:
steps:
- task: UseDotNet#2
displayName: 'Install .NET 6 SDK'
inputs:
version: 6.0.x
performMultiLevelLookup: true
https://learn.microsoft.com/en-us/azure/devops/pipelines/ecosystems/dotnet-core?view=azure-devops&tabs=dotnetfive#build-environment
Github thread about the issue:
https://github.com/dotnet/core/issues/6907
Issues will be resolved going through below are the checklist
Environment Variable (Set it to Root folder) for ex. C:/Program Files/DotNet as PATH variable - Reboot to get changes affected
Check Visual Studio Version
Run dotnet --info to check SDKs are already installed
Delete MSBuildSDKPath if it is set in Environment Variables
I had the same error when trying to build a solution using JetBrains Rider. The problem turned out to be Rider using wrong msbuild.exe. It was auto-detecting 2017 version instead of 2019. I had to manually adjust it in JetBrains settings in File | Settings | Build, Execution, Deployment | Toolset and Build. See more details here.

DevOps hosted pipeline fail to build .NET Core 2.2

With the release of .NET Core 2.2 I expected to be able to build such projects in our Microsoft-hosted DevOps (Azure) pipeline. But the restore step fails, saying 2.2 is not supported:
2018-12-11T14:57:49.0856135Z "D:\a\1\s\My.Project\My.Project.csproj" (Restore target) (1) ->
2018-12-11T14:57:49.0857867Z "D:\a\1\s\MyProject.EntityFramework\MyProject.EntityFramework.csproj" (_GenerateRestoreGraphProjectEntry target) (2:3) ->
2018-12-11T14:57:49.0858029Z (_CheckForUnsupportedNETCoreVersion target) ->
2018-12-11T14:57:49.0858191Z C:\Program Files\dotnet\sdk\2.1.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2. [D:\a\1\s\MyProject.EntityFramework\MyProject.EntityFramework.csproj]
2018-12-11T14:57:49.0858287Z
2018-12-11T14:57:49.0858338Z
2018-12-11T14:57:49.0858398Z "D:\a\1\s\My.Project\My.Project.csproj" (Restore target) (1) ->
2018-12-11T14:57:49.0858504Z "D:\a\1\s\My.Project\My.Project.csproj" (_GenerateRestoreGraphProjectEntry target) (1:5) ->
2018-12-11T14:57:49.0858645Z C:\Program Files\dotnet\sdk\2.1.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2. [D:\a\1\s\My.Project\My.Project.csproj]
The project builds fine locally, so I think it is most likely that I'm missing something - especially as I come up with nothing on my internet search for similar errors.
Could it really be it is not supported yet?
OK, so there is a task ".NET Core Installer" that can be added before the Restore task, and by requesting 2.2.100 to be installed first of all the build passes.
This does trick to my project:
steps:
- task: DotNetCoreInstaller#0
displayName: 'Use .NET Core SDK Tool Installer'
inputs:
version: 2.2.100
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
I had the same problem with my pipeline. Here is the solution:
Add to your job (press plus button) in the pipeline task .NET Core SDK Installer. You can search for it in a search box
Make sure to put that task on the top of your job. You can use drag&drop.
Set up version of .Net Core SDK Installer at least the same your version.
You can see all available version by pressing on the "here" word the in the popup
The answer of #bit0001 is correct. Microsoft has a list of supported versions that can be installed using this task. You can find those versions here.
As you can see, 2.1.500 is supported when installing the sdk, 2.1.0 is not, you'll need to use 2.1.300. When installing only the runtime, you can use 2.1.0. Currently, the latest 2.2 version supported is 2.2.100.

Install .NET core 2.0.0 on Manjaro for Rider IDE

I'm using Manjaro and I would like to use Rider instead of Visual Studio on Windows for my .Net class. Using pamac I found sdk and runtime for the version 2.1. However, I need the 2.0.0 version. I try to install it from binaries but Rider don't find it. The only one he found is 2.1 does anyone know how to do that ?
In Rider, go to File | Settings | Build, Execution, Deployment | Toolset and Build.
Modify values of two settings, .NET Core CLI executable path and Use MSBuild version, to point to your custom installation.

sln monotouch sample Load failed

monotouch sample solution fails to load
this solution gives me a load error. downloaded from here.
http://docs.xamarin.com/ios/getting_started/intro_to_mvc_in_ios
http://xamarin.com/pdf/Transitioning_from_Xcode_3_to_Xcode_4_in_Monotouch.pdf
here is a screenshot.
do I have to download a different version of monodevelop? how do i check the version of monotouch?
thanks
You will need to download MonoDevelop 2.8 alpha to work with the Xcode 4 support. If you go to "Help -> Check for updates", change the drop down to "Alpha" and it should allow you to download the latest MonoDevelop 2.8 alpha version.
It's worth installing MonoDevelop 2.8 side by side with MonoDevelop 2.4.2 (although, it might be worth trying out the MonoDevelop 2.6 support in the Beta channel too instead of 2.4.2 - this doesn't support Xcode 4 though).
Hope this helps,
ChrisNTR

Resources