Could not install package 'Splat 2.0.0' - xamarin.forms

Trying to install Splat 2.0.0 into Xamarin Forms project results with error:
Could not install package 'Splat 2.0.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.
How to resolve this issue please?
Thanks,
AG

I found this on the GitHub of your tool:
Please use Splat 1.6.2 when targeting PCL projects. v2.0 and onwards is netstandard only. There will be no updates to the 1.6.x series so if you need to patch the release then please fork and maintain your own copy/build from source.
It seems they stopped supporting PCL. So as a solution I suggest using Splat 1.6.2 as that seems to support ¨PCL. Good luck

Related

Which version of Microsoft.AspNet.Mvc is supported by .NETCoreApp v2.2?

I am working on a Ubuntu 18.04 environment using Visual Studio Code and .NET Core v2.2.
After including a few existing projects into a solution that I'm working on, I ran into errors when I tried to compile stating that the namespace "Microsoft.AspNet.Mvc" could not be found.
So, I added a package reference for the projects that were complaining by using the dotnet CLI:
dotnet add package Microsoft.AspNet.Mvc --version 3.0.20105.1
But now when I try to dotnet restore or dotnet msbuild the solution file, I'm getting warnings reporting that:
warning NU1701: Package 'Microsoft.AspNet.Mvc 3.0.20105.1' was
restored using '.NETFramework,Version=v4.6.1' instead of the project
target framework '.NETCoreApp,Version=v2.2'.
This package may not be fully compatible with your project.
I would like to figure out which package version of Microsoft.AspNet.Mvc I need to install in order to be compatible with .NET Core v2.2.
I realize that this is just a warning and using the .NETFramework v4.6.1 may be okay, but I have been debugging a very strange issue that is only happening on a Ubuntu environment, so I would like to determine whether package versioning is a problem.
I have tried Google searching to determine which version of MVC is compatible with .NET Core 2.2, but I have yielded any useful results.
Does anyone know the answer to this question? Or would you be able to point me in the direction of a source that can answer it?

Unable to find a version of 'Newtonsoft.Json'

My current asp.net mvc app needs 11.0.2 version of 'Newtonsoft.Json'
However, I want to add a nuget package "UmbracoCMS" that needs Newtonsoft.Json (>= 10.0.2 && < 11.0.0)'
Please let me know how I could handle this in the web.config
I tried assemblyredirect but that didn't help. Thank you.
Unable to find a version of 'Newtonsoft.Json'
This issue is not related to assembly-redirect, so you could not resolve it by web.config. That is because the prerequisite for assembly-redirect is that different versions of the Newtonsoft.Json assembly should be all acceptable for your project and we use assembly-redirect to select one of the version to our project.
Check a sample link.
However, your current question is that you can not get both versions to work for your project. Your asp.net mvc app needs 11.0.2 version of Newtonsoft.Json, but the nuget package UmbracoCMS that needs Newtonsoft.Json (>= 10.0.2 && < 11.0.0). You can not use both versions, so you can not use assembly-redirect to select one of the version to your project.
To resolve this issue, you have to resolve the reference conflict. Could you only use Newtonsoft.Json 11.0.2 for your asp.net mvc app? Can you use Newtonsoft.Json 10.0.2/10.0.3 instead? If yes, you can install Newtonsoft.Json 10.0.2/10.0.3, then you can install the nuget package UmbracoCMS. If not, I am afraid you could not install the nuget package UmbracoCMS.
Hope this helps.

Install a Nuget package ignoring ONE dependency

I'm sure this has been asked before, but I spent almost an hour searchin Stackoverflow and haven't found any answer. Sorry if I missed it.
I need to install a Nuget package without one (just one) of its dependencies.
In particular, I'm adding SignalR to an ASP.NET MVC app and I need to skip jQuery-dependency because I already have it added manually, from a CDN-hosting. Don't need it in my project.
But I need all the other dependencies, and I need them managed by Nuget, not manually. So if the author adds some new dependency to the next version, - like Owin or something, - it will be pulled in automatically.
The only solution I came up with is to install the package with all the dependencies and then run
Uninstall-Package jQuery -Force
Is this ok? It seems a bit "hacky" to me, or is it fine? Are there any other options?
I need to install a Nuget package without one (just one) of its
dependencies.
Not possible currently through Command Line, because Install-Package doesn't have any parameter to skip a particular dependency (as visible in the latest microsoft docs reference).
Use the below command if you want to avoid all of the Dependencies (as you can't skip a particular dependency because it is nowhere quoted in Microsoft Docs):
Install-Package Microsoft.AspNet.SignalR -IgnoreDependencies
Detail about the parameter from Install-Package document from Microsoft:
Install-Package [-Id] <string> [-Version <string>] [-IgnoreDependencies]
[-ProjectName <string>] [-Source <string>] [-IncludePrerelease] [-FileConflictAction]
[-DependencyVersion <dependencyVersion>] [-WhatIf]
IgnoreDependencies : Installs only this package and not its dependencies
Is this ok? It seems a bit "hacky" to me, or is it fine? Are there any other options?
The simple answer is "It depends on the version of jQuery-dependency which you have added manually ".
You will notice that the dependency restrictions of Microsoft.AspNet.SignalR is: jQuery (>= 1.6.4):
So if the version of jQuery which you have installed manually is higher than the version of dependency restrictions of Microsoft.AspNet.SignalR, you can uninstall the jQuery, then install the package Microsoft.AspNet.SignalR. Therefore, your method is feasible.
Note: After install the package Microsoft.AspNet.SignalR, you can update the version of the package jQuery, if you want.
In contrast, the version of jQuery which you have installed manually is lower than 1.6.4 and you do not want to use the high version of that package, you can not do it with your method, otherwise, NuGet will install the jQuery with version 1.6.4 after install the package Microsoft.AspNet.SignalR.
What I ended up doing is install jQuery nuget package and then simply remove files from the /Scripts directory
Now all the jQuery-dependent packages are happy and my project is not bloated with unneeded files

issues for NuGet after migrating a c# project

i'm trying to migrate a project into my visual studio 2012.
On the Manage NuGet Packages, I have this issue:
"Some NuGet Packages are missing from this solution. Click to restore from your online package sources"... but when i click on the restore button, it appears this issue:
"an error occurred while trying to restore packages: Unable to find version '4.1.0-alpha-121112' of package 'Microsoft.AspNet.WebApi'. "
i'm using .NET Framework 4
How can i solve?
Thanks in advance....
The problem is that version '4.1.0-alpha-121112' of package Microsoft.AspNet.WebApi does not exist on NuGet.org. It is not available on MyGet from the ASP.NET Web Stack Nightly package source either. So NuGet cannot restore it since it is no longer available.
Looking at Symbol Source it looks like this NuGet package was at one point available from the ASP.NET Web Stack Nightly package source on MyGet but it no longer seems to be available. I suspect they have deleted the old packages from that MyGet package source.
Unless you can find the original NuGet package, you will either have to manually remove the NuGet package reference, by editing the project file and packages.config file, and reinstall a version that exists.
1) Make sure you upgrade to the latest NuGet.
2) Make sure you're doing package restore "The Right Way" http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html
That should resolve the issue.
if still this ain't solve you can see this Rightway to migrate

Not able to Install Unity in VS2010

I am trying to install Unity from Nugget in VS2010 and receiving following error:
Could not install package 'Unity 3.5.1404.0'. 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.
Any Idea what could be Wrong?
I understand this package is not for VS2010 but for VS2012 or later. What is the way to get this package for VS2010 or VS2008?
Cheers
The problem is that Unity 3.5 requires .NET 4.5.

Resources