Build Error after Upgrading microsoft.net.sdk.functions - c#

My project uses .net framework 4.8. After upgrading microsoft.net.sdk.functions from version 1.0.24 to 3.0.1, the build on my local machine works fine, but there are some errors on the build on VSO pipeline:
microsoft.net.sdk.functions\3.0.1\build\microsoft.net.sdk.functions.build.targets(41,5):
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '3.0.0' was
not found
microsoft.net.sdk.functions\3.0.1\build\microsoft.net.sdk.functions.build.targets(41,5):
metadata generation failed.
There is no version 3.0.0 for Microsoft.NetCore.App nuget package. Why would the error ask for that version? Also how can I fix the error?

Looking at the package on NuGet, version 3.0.1 is intended for use with .NET Core 3.0 and higher applications, not .NET Framework applications. Version 1.0.38 appears to be the latest version with .NET Framework support (4.6 and higher).

Related

Webdriver Driver Mananger 2.7.0 not getting installed from Nuget with .Net framework 4.5

I want to use WebDriverManager in my code when I am trying to install the reference from the Nuget Package Manager I get an error.
I have tried updating and degrading the .Net framework.
Can we use WebDriverManager 2.7.0 with .Net framework 4.5?
Error Message seen is :
Could not install package 'WebDriverManager 2.7.0'. You are trying to install this package into a project that targets '.NETFramework, Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
I know this post is old but I ran into the same issue today and was able to figure it out. You need to install version 2.2.7 instead. WebDriverMangaer version 2.2.8 and above require .Net Standard 2.0 which is only compatible with .NET Framework 4.6.1 and above.

Can I target both .net standard2.0 and net471 in csproj file

I have a project that the target framework is .net standard 2.0, we use the System.Runtime.InteropServices.RuntimeInformation.OSDescription in our source code, but this library isn't support .net framwwork 4.6.1.Yesterday, one of our customer report a bug, about this question. his local framework is .net framework 4.6.1.
Can I set the target Framework to make a notice to user during they add the reference from Nuget Package?
And to make user to know if your local framework is 4.6.1, you should not use this version package and will cause bug.
When I set the target frameworks to:
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net471</TargetFrameworks>
<PropertyGroup/>
Then run dotnet build I get the error message:
error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.7.1" were not found.
To resolve this, install the SDK or Targeting Pack for this framework version
or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed.
Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies.
Therefore your assembly may not be correctly targeted for the framework you intend.
Then I go to the office website to download .net framework 4.7.1 SDK, but I install fail.
The error message is
A .NET Framework 4.7.1 or higher update has been installed on this computer
So I am confused!
Here is my dotnet --info
It seems I make a joke, I download the .net framework 4.7.1 from .net framework 4.7.1, but I can't install it. However, when I use Visual Studio Installer to install .net framework 4.7.1. It's fine.
And now run dotnet build, It success. More confused am I, Why can't install it from .exe file.

How to update to .NETStandard 2.0 NuGet Package

I've a good old .NET Framework 4.7 Class Library in Visual Studio 2015 currently using Microsoft.Extensions.Configuration NuGet package version 1.1.2. I'm trying to update this to version 2.0, but I'm getting this error:
Microsoft.Extensions.Configuration 2.0.0'. You are trying to install
this package into a project that targets '.NETFramework,Version=v4.7',
but the package does not contain any assembly references or content
files that are compatible with that framework. For more information,
contact the package author.
I see that the new version only supports .NETStandard 2.0. Do I have to convert all my project to either .NET Core or .NET Standard in Visual Studio 2017?
.NET Framework versions 4.6.1 and higher do support .NET Standard 2.0+, but only when using new tooling. Make sure you update to VS 2017 version 15.3.0 or higher and have the .NET Core SDK 2.0.0 installed and no global.json in your solution's directory hierarchy pinning a lower SDK version.
You may also need to install the .NET Core workload in VS 2017
Yes you have to convert your project to .Net standard 2.0 to use the Microsoft.Extensions.Configuration 2.0.0 package.
Check out the below link for .Net standard 2.0 supported .Net framework version
as of now the, .Net standard 2.0 supports only up to .Net framework 4.6.1
.Net standard 2.0 supported api

can not upgrade from EF Core 1.1.2 to version 2.0.0

All, I recently started working on a project that uses EF Core 1.1.2. I saw where 2.0 was released because I started getting errors when I tried to add EF core to a project.
I couldn't update the existing project, I created a brand new console project. Set the .Net framework to 4.6.1 and still had no luck. I always get the following message. Has anyone ran into this issue? thanks in advance
Install-Package : Could not install package 'Microsoft.EntityFrameworkCore.SqlServer 2.0.0'. You are trying to
install this package into a project that targets '.NETFramework,Version=v4.6.1', but the package does not contain
any assembly references or content files that are compatible with that framework.
EF Core 2.0 release has been officially announced and the documentation is (partially) updated.
Of course it's not NET Core only. But the actual prerequisites for targeting Full .NET Framework are as follows:
(1) Project targeting .NET Framework 4.6.1 and above.
(2) Visual Studio 2017 with (important!) 15.3.0 update (also just released) installed
Before updating the VS I was getting the same error. After updating the error is gone and EF 2.0 package is successfully installed.
EF Core 1.1.2 had a dependency on .NETStandard 1.3 or .NETFramework 4.5.1. So as you were targeting .NetFramework 4.5.2 everything is hunky dory.
EF Core 2.0 has a dependency on .NETStandard 2.0. This is not compatible with the .NETFramework, everything is far from hunky dory.
According to the source below you can get .NetFramework support with 2.0 tooling, which is in preview:
https://dotnet.myget.org/feed/dotnet-core/package/nuget/NETStandard.Library.NETFramework
The alternative would be to migrate your application so it doesn't use the .NetFramework but only targets .NETStandard libraries.
Sources
https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.SqlServer/2.0.0
https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.SqlServer/1.1.2
https://learn.microsoft.com/en-us/dotnet/standard/net-standard
Good luck.
EntityFramework Core 2.0.0 is not compatible with a Target framework other than Core 2.0.0. You will need to ensure your project is targetting this and install any dependancies.
It will NOT work with the (standard) .NET framework versions, it is a 'Core' specific release.

Use Entity Framework in .net 4.0 with Oracle database - possible?

I am building an application that targets .Net 4.0 (cannot be higher for the moment). I need to get access to Oracle Db (11g) and I wanted to use Entity Framework.
To be able to do that I know that I have to use:
Oracle.ManagedDataAccess
Oracle.ManagedDataAccess.EntityFramework
The first one is no problem, however when I try to install the Oracle.ManagedDataAccess.EntityFramework NuGet package, I get the following message:
Could not install package 'Oracle.ManagedDataAccess.EntityFramework
12.1.2400'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', but the package does not contain
any assembly references or content files that are compatible with that
framework. For more information, contact the package author.
When I change target framework to 4.5.2 the package installs and everything works fine so I am assuming that this package is somehow dependent on .Net framework ~4.5.
Is there any workaround to make it work with .Net 4.0?
Edit:
Just to be clear, I have instaled Entity Framework 6.1.3 as this is prerequisite for installing Oracle's EF provider
Oracle.ManagedDataAccess.EntityFramework has a dependency to EntityFramework (>= 6.0.0 && < 7.0.0) so you can install first Entity Framework 6.1.3 from nuget that version works on .Net Framework 4.0 and then Oracle.ManagedDataAccess.EntityFramework
I had the same problem, and found that Oracle.ManagedDataAccess.EntityFramework 12.2.1100 it was built for .net 4.5.
Assembly explorer screenshot
So, I believe that we can not use Oracle.ManagedDataAccess.EntityFramework 12.2.1100 with .net 4.0.
upd:
I received the explanation of that situation from Oracle .NET Team:
From: "Oracle .NET Team"
Date: 16 августа 2017 г., 0:58:31
Theme: Reply: [NuGet Gallery] Message for owners of the package 'Oracle.ManagedDataAccess.EntityFramework'
Hi Yuriy,
Microsoft desupported .NET Framework 4 support for versions 4.5.1 and
earlier as of January, 2016. In the newest ODP.NET release, Oracle
follows that support policy.
Oracle did not change ODP.NET such that
it only works in .NET 4.5.2 and newer versions. Microsoft did not
change .NET that prevents backwards compatibility. It's actually
likely that the new ODP.NET will work fine with the older .NET 4
versions. I'm not aware of any incompatibilities. Oracle just doesn't
officially support nor certify the earlier .NET versions anymore.
Regards, Oracle .NET Team

Categories

Resources