Framework Compatibility Issue While Installing MaterialDesignThemes.Wpf from Nuget - c#

I am trying to run this
project from github. But when it comes to installing to MaterialDesignThemes.Wpf for wpftoolkit. it fails due to compatibility issue.Here is the full error:
"Error Could not install package 'MaterialDesignColors 1.1.1'. 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."
I tried with changing the project target framework but it did not work.
Could any body please help in resolving this issue?
Thanks

Related

How do I install System.Drawing.Common in a project that uses '.NETFramework,Version=v4.5.2'?

I am trying to write some unit tests in C# in a '.NETFramework,Version=v4.5.2' application but all tests give the next error:
'System.IO.FileNotFoundException : Could not load file or assembly
'System.Drawing.Common, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file
specified.'
When I try to install System.Drawing.Common I get the next error from the NuGet package:
Could not install package 'System.Drawing.Common 4.5.1'. 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.
I cannot change the application version or the framework (.NET Core 2.1) and any other trick I found online did not work (or generated more errors).
Help?
in NuGet put this line :
Install-Package System.Drawing.Common -Version 4.5.2
in .NET CLI put :
dotnet add package System.Drawing.Common --version 4.5.2
in Paket CLI put :
paket add System.Drawing.Common --version 4.5.2
Had the same problem. I have cloned solution https://github.com/barnhill/barcodelib . It has two projects: library project targets .Net Standard 2.0 and refers to System.Drawings.Common. Example project depends on library and has reference to System.Drawings.Common. Example project was not compiling due to same error.
My solution was just to remove reference to System.Drawings.Common in nuget packages and readd it (rclick on Example project > Manage nuget packages > Browse Installed, remove the System.Drawings.Common package, and then add it back), unload project and then reload it again
Helped for me.
I managed to solve it by restarting Visual Studio, changing the framework to 4.6.1 (which I could not do before) and adding the reference.
OP's solution migrated from the question to an answer.
you could try to use one of the libs described in here instead https://devblogs.microsoft.com/dotnet/net-core-image-processing/
you could try to use https://www.nuget.org/packages/CoreCompat.System.Drawing/ as well and maybe try to change your app framework to .net standard 2.0?
This is kind of bizarre but it worked dramatically so I'm going to mention it. I built a small vs 2017 ent console project that was supposed to read an oracle database. When I started to run it I got the System.Drawing.Common error mentioned above. It seemed stupid because I wasn't really doing anything having to do with Drawing at all. In Manage Nuget Packages I deleted the Oracle.ManagedDataAccess driver and added the Oracle.ManagedDataAccess.Core and the System.Drawing.Common error went away and I was able to read my oracle database. So I'm suggesting that with NuGet you may be picking up some things you really don't need and if you have any choice for your NuGet packages, try different ones. This also may be some foible with how my organization managed nuget for Visual Studio 2017 enterprise.

'System.Web.Mvc.VirtualPathProviderViewEngine' is defined in an assembly that is not referenced

The complete error is "'System.Web.Mvc.VirtualPathProviderViewEngine' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'"
I have an Asp.Net Mvc 4 application build in Visual Studio 2010 that does not build on one machine but builds on another machine without issue. Through the tips System.web.mvc missing I discoverd that the machine that builds does indeed have MVC 3 version 3.0.50813.0 and the machine that does not build has MVC 3 version 3.0.20105.0 so I uninstalled MVC 4 and MVC 3 and attempted every combination of uninstall and reinstall between downloaded installers and the web platform installer but the problem machine still gets the older version. I decide that I will just attempt to fix the project by upgrading the NuGet package for the one project using the suggestion from the question
Install-Package Microsoft.AspNet.Mvc -Version 3.0.50813.1
at which point it the following error with the NuGet package Manager
"Install-Package : The schema version of 'Microsoft.AspNet.Mvc' is incompatible with version 2.0.30625.9003 of NuGet. Please upgrade NuGet to the latest version" In attempting to fix that I find this Nuget versioning issue with package restore
I performed the answer from there and got the same error when attempting to install the NuGet package, which makes sense because it is looking for an older version of NuGet.
I also looked at this MS14-059 but my project does not even reference the MVC 3 dll so the manual update option is out and I have tried the NuGet package.
My question is
Does anyone know where I can find an installation of the MVC 3 framework for version 3.0.50813.0
OR
How I can get the NuGet package to install in my solution.

Cannot update nuget package (PCL)

I'm getting this error when using maps in Android:
System.MissingMethodEsception: Method
'Xamarin.Forms.maps.Android.MapRenderer.OnCameraChange' not found.
And I've read that you can update the nugetpackage to fix the issue. However, I cannot install it due to this:
Could not install package 'TK.CustomMap 2.0.1'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile78', 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.
The updates of packages installs just find in iOS and Android but not for PCL. I've tried to remove all the packages and then tried to add TK.Customs nuget package but this same issue.
Also tried to install it on a fresh project and that installed just fine. Just cant get it to install on my old project.
Here is the whole error message when trying to update package:
Attempting to gather dependency information for package 'TK.CustomMap.2.0.1' with respect to project 'Vernamo', targeting '.NETPortable,Version=v4.5,Profile=Profile78'
GET https://api.nuget.org/v3/registration3-gz-semver2/tk.custommap/index.json
OK https://api.nuget.org/v3/registration3-gz-semver2/tk.custommap/index.json 175ms
Total number of results gathered : 29
Gathering dependency information took 232 ms
Summary of time taken to gather dependencies per source :
https://api.nuget.org/v3/index.json - 204.03 ms
Attempting to resolve dependencies for package 'TK.CustomMap.2.0.1' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'TK.CustomMap.2.0.1'
Resolved actions to install package 'TK.CustomMap.2.0.1'
Found package 'TK.CustomMap 2.0.1' in '/Users/holger/Downloads/Vernamo/packages'.
For adding package 'TK.CustomMap.2.0.1' to project 'Vernamo' that targets 'portable45-net45+win8+wp8'.
Install failed. Rolling back...
Package 'TK.CustomMap.2.0.1' does not exist in project 'Vernamo'
Executing nuget actions took 52 ms
Could not install package 'TK.CustomMap 2.0.1'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile78', 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.
The pre-release version (at least pre2) of TK.CustomMap supported all platforms (see here), anyway, as of pre3 (see here), obviously the support for all platforms was dropped in favor of .NET Standard (1.1 in this case).
The profile you are using in your PCL does not seem to be compatible with .NET Standard 1.1, hence NuGet fails to add the reference. You may try to switch to another profile (.NET 4.5.1 for example), but I don't know if that would help. Another option would be to migrate your projects to .NET Standard. It's kind of a stupid, repetetive task, but it's possible.

Error loading packages in cross platform c# application

I offloaded a project which involved making a cross platform app from a website. My friend who was supposed to do the project, has given me a solution that contains a portable section and a droid section. The ios and windows apps will be made once i complete the remaining portions of the portable code.
Now, he used some packages that are failing to load completely on my system. He had compiled an apk from this code, so this code must be working, but I cannot resolve the issues with the packages. I removed the packages directory from the project he supplied to me, and rebuilt the project hoping the packages would restore themselves correctly. But I ended up with the same errors again.
Then I found that "Mono.Android" and "RestSharp" were marked with warning signs under the references list. So I removed these two, and tried installing them fresh from Nuget Package Manager. Trying to install RestSharp gave me the following error:
Could not install package 'RestSharp 104.5.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile259', 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.
And I also cannot find "Mono.Android" package in the Nuget Package Manager. My friend was unable to help me out on this. Please suggest how to get this project working.
Thanks in advance.
Debopam Parua

Xamarin.Forms can't install Microsoft.Azure.Mobile.Client.SQLiteStore 2.1.1

Good morning all,
I am following the instructions on the azure site for adding offline sync capability in a Xamarin.Forms application.
I have added the package to the PCL without issue but when trying to add to the iOS client project I am getting the following error:
Could not install package 'Microsoft.Azure.Mobile.Client.SQLiteStore 2.1.1'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.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.
My project is well established in terms of completed code base so I downloaded the getting started app to test from scratch and the same issue remains.
Please help
Jordan Mazurke
Looks lite something is wrong with package 2.1.1.
Install version 2.1.0 instead and it should work!
See also Unable to install Microsoft.Azure.Mobile.Client.SQLiteStore 2.1.1 into Xamarin.iOS project with NuGet 2.12

Categories