I am working on an ASP.NET project in which I need to do simple HTML templating.
The prettiest solution seems to be RazorEngine, which depends on Microsoft.AspNet.Razor. However, when trying to install Microsoft.AspNet.Razor via Nuget, the following error message is shown:
Installing 'Microsoft.AspNet.Razor 3.0.0'. Successfully
installed 'Microsoft.AspNet.Razor 3.0.0'. Adding
'Microsoft.AspNet.Razor 3.0.0' to EBulkDBSManagementApp.
Uninstalling 'Microsoft.AspNet.Razor 3.0.0'. Successfully
uninstalled 'Microsoft.AspNet.Razor 3.0.0'. Install failed.
Rolling back... Could not install package
'Microsoft.AspNet.Razor 3.0.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 solution?
The latest RazorEngine 3.4.0 NuGet package depends on the Microsoft.AspNet.Razor 3.0.0 NuGet package which requires .Net 4.5
If you wish to use RazorEngine with a version of .NET prior to 4.5, then you will need to use the RazorEngine 3.3.0 NuGet pacakage.
You can install this using the package manager console with the following command.
Install-Package RazorEngine -Version 3.3.0
Related
I have this problem in my web service:
Specified Web Pages version “3.0.0.0” could not be found. Update your
web.config to specify a different version. Current version: “2.0.0.0”
Install Microsoft.AspNet.WebPages nuget package by entering this line in package manager console:
Install-Package Microsoft.AspNet.WebPages -Version 3.0.0
Or find and install it using Nuget Package Manager.
Go to the Nuget Package Manager in Visual Studio Code. Search for Microsoft.AspNet.WebPages and update this package if you already have the latest one the you should try to downgrade one version previous.
Or
You can run the below command in Package Manager Console in Visual Studio:
Install-Package Microsoft.AspNet.WebPages
This will resolve the issue.
I have created project in asp.net MVC with 4.5 framework in 2015 VS. I am trying to add Microsoft.Owin.Host.SystemWeb this package from nuget package manager but getting error like
Could not install package 'Microsoft.Owin 4.0.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.
Even if I changed framework still getting error and
Microsoft.Owin.Host.SystemWeb latest Version of this package is 4.0.
f you are installing last versions of SignalR you will not be able as it has some dependencies that require .Net4.5, but you can still install an old version of SignalR which uses .Net4.0, like
1.1.3 Install-Package Microsoft.AspNet.SignalR -Version 1.1.3
This is not the case any more, and the 2.x releases require .NET 4.5.
https://github.com/SignalR/SignalR/issues/1723
Why can't I install Newtonsoft.Json in a .NET 4.0 project considering its dependencies?
I have a .NET class library project targetting .NET 4.0 that references the Newtonsoft.Json 4.5.6 NuGet package. I want to upgrade Newtonsoft.Json to the latest version (v10.0.3). This fails with the following message printed out on the Package Manager Console:
Could not install package 'System.Net.Http 4.0.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.
The dependency behavior on install was: "Lowest".
Looking at the dependencies of Newtonsoft.Json NuGet package shows:
.NETFramework,Version=v4.0
No dependencies
Am I misinterpreting something? I expected that it can be installed in a .NET 4.0 project.
The full install log is:
Attempting to gather dependency information for package 'Newtonsoft.Json.10.0.3' with respect to project 'XYZ', targeting '.NETFramework,Version=v4.0'
Attempting to resolve dependencies for package 'Newtonsoft.Json.10.0.3' with DependencyBehavior 'Lowest'
Resolving actions to install package 'Newtonsoft.Json.10.0.3'
Resolved actions to install package 'Newtonsoft.Json.10.0.3'
Removed package 'Newtonsoft.Json.4.5.6' from 'packages.config'
Successfully uninstalled 'Newtonsoft.Json.4.5.6' from XYZ Removed package 'System.Net.Http.2.0.20710' from 'packages.config'
Successfully uninstalled 'System.Net.Http.2.0.20710' from XYZ
Adding package 'Newtonsoft.Json.10.0.3' to folder 'c:\MAIN\packages'
Added package 'Newtonsoft.Json.10.0.3' to folder 'c:\MAIN\packages'
Added package 'Newtonsoft.Json.10.0.3' to 'packages.config'
Executing script file 'c:\MAIN\packages\Newtonsoft.Json.10.0.3\tools\install.ps1'...
Successfully installed 'Newtonsoft.Json 10.0.3' to XYZ Install failed.
Rolling back...
Package 'System.Net.Http.4.0.0' does not exist in project 'XYZ'
Removed package 'Newtonsoft.Json.10.0.3' from 'packages.config'
Adding package 'System.Net.Http.2.0.20710', which only has dependencies, to project 'XYZ'.
Package 'System.Net.Http.2.0.20710' already exists in folder 'c:\MAIN\packages'
Added package 'System.Net.Http.2.0.20710' to 'packages.config'
Package 'Newtonsoft.Json.4.5.6' already exists in folder 'c:\MAIN\packages'
Added package 'Newtonsoft.Json.4.5.6' to 'packages.config'
Removing package 'Newtonsoft.Json.10.0.3' from folder 'c:\MAIN\packages'
Removed package 'Newtonsoft.Json.10.0.3' from folder 'c:\MAIN\packages'
Could not install package 'System.Net.Http 4.0.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.
========== Finished ==========
The only way to install Newtonsoft.Json into the .NET 4.0 project was to use dependency behavior "Ignore Dependencies".
Try to run in Packager manager console
Install-Package Newtonsoft.Json -Version 4.0.8
I'm using .netcore 1.0.1 on Ubuntu 16.04. When tying to add the Google.Cloud.Datastore.V1 package to my project (dotnet add package Goolge.Cloud.Datastore.V1) I get the following error:
Unable to resolve 'Google.Cloud.Datastore.V1' for '.NETStandard,Version=v1.5'. The package mentions it support .NetStandard 1.5. I tried installing it with the -Pre tag but dotnet add package doesn't like the -Pre.
Can anyone point me in the right direction?
Google.Cloud.Datastore.V1 now available only as a prerelease package. dotnet add package Google.Cloud.Datastore.V1 tries to install the last released package and so cannot find any suitable one.
As right now dotnet add doesn't support -prerelease flag, you need to specify prerelease version directly to install it:
dotnet add package Google.Cloud.Datastore.V1 -v 1.0.0-beta08
I'm trying to install the Stripe.net 6.12.0 nuget package in my project. It has a dependency on the Json.NET 9.0.1 nuget package which I have installed, but when I go to install stripe.net, visual studio gives me the error message: "Stripe.NET already has a dependency defined for"Newtonsoft.Json'. What do I have to do to install Stripe.NET?
Was not obvious from the error message, but the solution was simply to upgrade Nuget. Was using 2.8.xxx and upgraded to the latest which is 2.12.xxx. Restarted. Fixed the problem.