Upgraded .NET Core projects from v1.0 to v1.1 and facing the following errors - upgrade

I upgraded my .NET Core projects from v1.0 to v1.1 and facing the following errors
Package Microsoft.Net.Http 2.2.29 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1).
Package Microsoft.Bcl 1.1.10 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1) / win10-x64
All the projects in the solution are compiling and says "Rebuild Success" but still these errors shows up in the "Error List".
I am using Visual Studio 2017.
Is there a fix ? Please advise.

Check your output, I've just tried installing Microsoft.Net.Http into my NetCore1.1 project and got the same. Reading the output for the nuget install I see this:
Installing Microsoft.Net.Http 2.2.29.
Package Microsoft.Net.Http 2.2.29 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.Net.Http 2.2.29 supports:
- monoandroid (MonoAndroid,Version=v0.0)
- monotouch (MonoTouch,Version=v0.0)
- net40 (.NETFramework,Version=v4.0)
- net45 (.NETFramework,Version=v4.5)
- portable-net40+sl4+win8+wp71+wpa81 (.NETPortable,Version=v0.0,Profile=net40+sl4+win8+wp71+wpa81)
- portable-net45+win8 (.NETPortable,Version=v0.0,Profile=Profile7)
- portable-net45+win8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile111)
- sl4-wp71 (Silverlight,Version=v4.0,Profile=WindowsPhone71)
- win8 (Windows,Version=v8.0)
- wpa81 (WindowsPhoneApp,Version=v8.1)
- xamarinios10 (Xamarin.iOS,Version=v1.0)
Package Microsoft.Bcl 1.1.10 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.Bcl 1.1.10 supports:
- monoandroid (MonoAndroid,Version=v0.0)
- monotouch (MonoTouch,Version=v0.0)
- net40 (.NETFramework,Version=v4.0)
- net45 (.NETFramework,Version=v4.5)
- portable-net40+sl4+win8 (.NETPortable,Version=v0.0,Profile=net40+sl4+win8)
- portable-net40+sl4+win8+wp71+wpa81 (.NETPortable,Version=v0.0,Profile=net40+sl4+win8+wp71+wpa81)
- portable-net40+sl4+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=net40+sl4+win8+wp8+wpa81)
- portable-net40+sl5+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile328)
- portable-net40+win8 (.NETPortable,Version=v0.0,Profile=Profile5)
- portable-net40+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=net40+win8+wp8+wpa81)
- portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)
- portable-net45+win8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile111)
- portable-net451+win81 (.NETPortable,Version=v0.0,Profile=Profile44)
- portable-net451+win81+wpa81 (.NETPortable,Version=v0.0,Profile=Profile151)
- portable-win81+wp81+wpa81 (.NETPortable,Version=v0.0,Profile=Profile157)
- sl4 (Silverlight,Version=v4.0)
- sl4-wp71 (Silverlight,Version=v4.0,Profile=WindowsPhone71)
- sl5 (Silverlight,Version=v5.0)
- win8 (Windows,Version=v8.0)
- wp8 (WindowsPhone,Version=v8.0)
- wpa81 (WindowsPhoneApp,Version=v8.1)
- xamarinios10 (Xamarin.iOS,Version=v1.0)
One or more packages are incompatible with .NETCoreApp,Version=v1.1.
Package restore failed. Rolling back package changes for 'Notams.Query'.
Time Elapsed: 00:00:03.7728926
========== Finished ==========
As you can see, this package does not support .Net Core or .Net Standard yet. Also your Microsoft.Bcl dependency comes from Microsoft.Net.Http and similarly does not support .Net Standard/Core
Your best bet is to switch to System.Net.Http which does support .Net Standard and .Net Core

Related

Mac - VS 8.10 - New 3.1 Project - Install Postsharp

I created a new, console application. Nuget => Add PostSharp =>
Reading project file
/Users/jason/Projects/Postsharp/Postsharp/Postsharp.csproj.
Restoring packages for
/Users/jason/Projects/Postsharp/Postsharp/Postsharp.csproj...
Restoring packages for .NETCoreApp,Version=v3.1... Resolving conflicts
for .NETCoreApp,Version=v3.1... Cycle detected. Postsharp ->
PostSharp (>= 6.10.6). Checking compatibility of packages on
.NETCoreApp,Version=v3.1. Checking compatibility for Postsharp 1.0.0
with .NETCoreApp,Version=v3.1. Checking compatibility for Serilog
2.10.0 with .NETCoreApp,Version=v3.1. All packages and projects are compatible with .NETCoreApp,Version=v3.1. Package restore failed.
Rolling back package changes for 'Postsharp'.
Cycle Detected?
Geez, what am I doing wrong?
Thanks,
Jason
This is caused by naming your project PostSharp and having a dependency on the package of the same name.
Daniel, you were right, the project name was part of the problem.
The biggest issue was I needed to manually set PostSharpDependencyRestoreDisabled=True and then I had to manually add all the referenced Nuget packages. It was annoying, but at least it works now.
Thanks!

Action is pulling the wrong Ruby version

I have the following action on my project:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
gemfile:
- Gemfile
- gemfiles/Gemfile-rails-5-2
- gemfiles/Gemfile-rails-6-0
- gemfiles/Gemfile-rails-6-1
- gemfiles/Gemfile-rails-7-0
ruby:
- 2.6
- 2.7
- 3.0
- 3.1
exclude:
- ruby: 2.6
gemfile: Gemfile
- ruby: 2.6
gemfile: gemfiles/Gemfile-rails-7-0
- ruby: 3.0
gemfile: gemfiles/Gemfile-rails-5-0
- ruby: 3.1
gemfile: gemfiles/Gemfile-rails-5-0
- ruby: 3.0
gemfile: gemfiles/Gemfile-rails-5-1
- ruby: 3.1
gemfile: gemfiles/Gemfile-rails-5-1
- ruby: 3.0
gemfile: gemfiles/Gemfile-rails-5-2
- ruby: 3.1
gemfile: gemfiles/Gemfile-rails-5-2
as stated, I have Ruby versions 3.0 and 3.1.
Now I noticed the weirdest thing: Tests for Ruby 3.0 are using 3.1, as the output shows.
I assume it has something to do with the fact that the Ruby versions are not quoted. To test that assumption, I quoted all the Ruby versions and now the tests are using the right version. This actually fixed the problem but it left me scratching my head:
First, the VSCode linter complains about the file:
but I don't see any problems on GitHub.
Second, I noticed that other gems like Devise don't use quoted Ruby versions and its tests are just fine, using the right Ruby version...
So what is going on?
I noticed that for previous actions, before I quoted the versions, this is what Github was showing:
as one can see, it shows 3 instead of 3.0 and I suspect that this is why Ruby was evaluating to 3.1 instead of 3.0.

Cannot Add a Migration using EF Core 6

I have installed Visual Code 2022 preview (17.1). I have created a simple console app following https://learn.microsoft.com/en-us/ef/core/get-started/overview/first-app?tabs=netcore-cli
When I try to add a migration I get the following error
> dotnet ef migrations add One
Build started...
Build succeeded.
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.0.0' (x64) was not found.
- The following frameworks were found:
5.0.8 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
6.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.0.0&arch=x64&rid=win10-x64
Why would it want dot net 2.0?
Add the package Microsoft.EntityFrameworkCore.Design to your main project. if that doesn't work, add to your Data Access layer (project).

Azure Devops - Compatibility problems moving from .NET Core 3.1 to .NET 5 at Nuget Package

I have a .NET Core solution which was running well using .NET Core 3.1 using a Pipeline on Azure Devops. Everything was working fine on the Pipeline.
After moving from .NET Core 3.1 to .NET 5.0, I started to have some strange troubles running the pipeline, specifically with Nuget packages.
I can build with no problems, but when it starts to pack using Nuget Package, I've got this error:
[error] The nuget command failed with exit code(1)
NU1202: Package Microsoft.EntityFrameworkCore 5.0.0 is not compatible with net50 (.NETFramework,Version=v5.0). Package Microsoft.EntityFrameworkCore 5.0.0 supports: netstandard2.1 (.NETStandard,Version=v2.1)
Some weird fact is that this solution is running fine at the local machine.
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.8.8.9</Version>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
I already tried to change the OS on the Build, but I've got this error:
The current available version of MSBuild is 16.7.0.37604. Change the .NET Core SDK specified in global.json to an older version that requires the MSBuild version currently available.
Does someone have an idea?
Package Microsoft.EntityFrameworkCore.Relational 5.0.0 supports:
netstandard2.1 (.NETStandard,Version=v2.1)
This is because it was using an old version of Nuget. You can try to change it to 5.x and restore.
Here is a case with similar issue you can refer to.

Does Azure Pipeline Support .NET Core 3.1.7?

This is the error I get:
This is my configuration:
Can anyone help me?
I fix that for the latest .NET release.
The issue can be fixed with this line of code in your pipeline (.yaml) file.
steps:
- task: UseDotNet#2
displayName: 'Use .NET Core sdk 6.0.x'
inputs:
version: 6.x
includePreviewVersions: true
Just add the above step to your YAML file.
When you set the .NET Core SDK version to 3.x, it automatically download and install the latest in major version SDK 3.1.401, but SDK 3.1.401 is included in
Visual Studio 16.7.1. Since the hosted agent installed Visual Studio 16.6.30320.27, which doesn't include SDK 3.1.401, you would get the error during the build.
Currently, you could set the .NET Core SDK version to 3.1.302, or 3.1.107, which should solve your issue.
https://dotnet.microsoft.com/download/dotnet-core/3.1
This issue has been reported to product team in the following case, you can follow the case to track the status:
https://developercommunity.visualstudio.com/content/problem/1145815/net-coremsbuild-tooling-not-finding-right-version.html