I just started to play around with C# application using the .NET framework.
I'm trying to install from Nuget the official neo4j driver package for c# but, despite the fact that from the documentation is stated that it should work with any version of .NET language (here), I got an incompatibility error from one of its dependencies (System.Net.NameResolution 4.0.0)
My application is a Console Application and the target framework is .NET framework 4.5.2.
In particular the error I get is:
Could not install package 'System.Net.NameResolution 4.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5.2', 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.
Do you have any idea on how to solve this? I think I'm missing something obvious.
Thanks in advance
Your link states that it works with any .NET language not that it works with any version of the .NET framework. This package appears to be for dotnet core only, so you will need to look into getting started with that.
Related
Long story, summarized...
I started working on a solution creating many projects (like class libraries) for the solution. Then I ended up needing to use a third-party SDK for something I had an expensive license for. Come to find out, that third-party SDK only supported .NET Framework.
Because my solution was based in .NET 5/Core and the SDK in .NET Framework I had a big issue. They can not exist in the same environment and reference each other. So, on to biting the bullet and spending hours converting all my projects to .NET Framework 4.8 while singing a neverending song of curse words...
The Issue
My first class library I'm trying to convert from .NET5 to .NET 4.8 happens to have a Nuget package installed. That Nuget is Newtonsoft.Json Version="12.0.3" (https://www.nuget.org/packages/Newtonsoft.Json).
After changing the framework in the project file, VSCode is telling me the Newtonsoft namespace can not be found. This makes me think that the Nuget I have installed is not compatible with .NET Framework 4.8.
The issue I was running into was the namespace Newtonsoft could not be found after changing the framework from net5.0 to net48.
The issue was OmniSharp that was giving a false positive. I restarted VSCode and the issue went away once VSCode loaded with the new framework being used.
.NET supports cross platform targeting which means you can have your SDK style .NET5 project multi-targets both net5 and net48. In future, if the third-party library targets .NET Core then you can simply change the TargetFrameworks property.
A similar issue has been discussed here https://github.com/dotnet/runtime/discussions/40304 incase if that helps.
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.
This question already has answers here:
Installing a .NetStandard 2.0 Nuget package into a VS2015 Net 4.6.1 project
(2 answers)
Closed 3 years ago.
I am so confused.. I am trying to install a nuget package that has a dependency on .NetStandard v2.0, after reading this post about it, it made sense to me that I could run any library that is dependent on .NetStandard 2.0 with .Net 4.7.2. Unfortunately, while trying to install a nuget package, it fails, saying it is not compatible with .net 4.7.2.
I am mainly trying to add the new Roslyn libraries Microsft.CodeAnalysis and if you look at the dependencies it says it supports .Net 4.7.2, the issue seems to stem from another dll its dependent on Microsoft.CodeAnalysis.CSharp.Workspaces, as that says it only has a dependency on .NetStandard 2.0. (but really .Net 4.7.2 can run .NetStandard 2.0)
Does anyone know if this is possible or will I be needing to move to .net core framework to be able to support a project like this?
Really it should say it only has a dependency on .NetStandard 2.0 but be able to get installed onto a target framework with 4.7.2 or .Net Core
Edit:
Using Visual Studio 2015 and C#6.
Its a rehosted windows workflow designer application (working on c# compilation/intellisense for inputs to the designer)
Thanks to #IanKemp for finding an answer that helped me, I will flag this post as a duplicate but I wanted to first post a step-by-step fix for future developers that may come across this.
So I downloaded the latest Nuget version (VS 2015 VSIX - latest v3.6.0) here
Then I tried to update to the latest Roslyn package via NuGet package mananger and got this error message:
The message points you to this link, that will download the .Net Standard Build Support extension: https://aka.ms/netstandard-build-support-netfx
I then tried to update to the latest Roslyn package and it all worked!!
Happy coding all.
This question is not a duplicate
I am scripting in Unity using C# with the build in MonoDeveloper-Tool.
When I run the script I got the error message, that the assemblys for framework ".netframework, version=v4.7.1" has not been found. I looked it up on stackoverflow and only found this article:
The reference assemblies for framework ".NETFramework,Version=v4.6.2" were not found
So I downloaded this version, but I can't install it, because I already have the latest version installed from .net framework, which is currently .NET Framework 4.7.2
Questions:
Is MonoDeveloper in "Unity 2018.3.12f1 Personal" not supporting this version?
Are there ways to upgrade it to make it work?
Or do I have to remove the .net-version, that I have and get an older one to make it work?
The message you are getting is ususally related to scripting backend setting in PlayerPreferences.
Here's a screenshot from 2017
and from 2019
It defaults to 3.5 for new projects, and you need to manually set it to 4.x, than pretty much all features from 4.7 work fine
Is MonoDeveloper in "Unity 2018.3.12f1 Personal" not supporting this version?
MonoDeveloper supports, but Unity doesn't.
Are there ways to upgrade it to make it work?
Try install .net 4.6 with Visual Studio Installer or upgrade the Unity.
I am trying to change the .net framework for a android c# app in visual studios 2013. I tried to create a new project with .net framework 4.0 but I still get an error saying that my application is targeting the 4.5 framework. Does anyone know how to force this? The reason I am doing this is that I have a nuget package that uses the 4.0 framework, however if there is a way to get that nuget package to use the 4.5 framework that is an equally valid solution.
You cannot change the .net framework for an Android app. It will always be targeting MonoAndroid.
You cannot use a NuGet package that only assemblies for the .NET framework since they may use parts of the Xamarin Android API that is not supported.
So you are left with finding another NuGet package that supports Android projects or re-compiling the source code in an Android library project so it targets MonoAndroid, which may or may not work depending on what the source code does.