I am trying to install serilog and I'm getting error
PM> Install-Package Serilog
Install-Package : 'Serilog' already has a
dependency defined for 'Microsoft.CSharp'. At line:1 char:1
+ Install-Package Serilog
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
Microsoft.CSharp is already referenced in my project
As #Tieson T. said, Update "Nuget Package Manager for Visual Studio" from Visual Studio Window > Tools > Extensions and Updates > Click Updates tab. Select Nuget plugin and update. Then restart the visual studio after installation complete. I tried (Windows 8.1 64bit & Visual Studio 2013 Ultimate) and it works.
To add to this. I had a similar issue but the problem was due to our build server being based on TFS 2012 and using an old version of MSBuild (which we can't update in the near term). Everything built and ran fine locally, but when the build server tried to run we got the same error.
The workaround I found was to go into the packages folder of the solution, find the package having the issue (in my case Serilog.2.3.0 and the associated Sink packages I had installed). Open the "lib" folder and you should see some folders associated to the various .Net frameworks. Delete the netstandard folders which correspond to the .Net Core versions.
The downside to this is you have to check in the folders you modify like this so MSBuild doesn't try to restore them.
Please do the 2 steps below, it works for me or teamcity/jenkins
If you still using the Nuget CommandLine 2.8, please try to upgrade to 3.5.
If you using the private Nuget Server, Please update the Serilog.2.3.0.nupkg with the steps below:
2.1 Update Nuget Spec File:
Remove
...
...
2.2 Remove the folder lib/netstandard1.0 and lib/netstandard1.0
2.3 Then redeploy the Serilog.2.3.0.nupkg to your private Nuget Server
Related
I have created a new MVC Web App project in the Visual Studio 2019 (Targeting .NET 5.0)
Now I want to install EntityFrameworkCore, but it doesn't appear on the list when I search in the NuGet manager. If I type "entity", only 3 options appear. If I type more than that, nothing more appears.
I also tried typing (in the console manager)
Install-Package Microsoft.EntityFrameworkCore -Version 5.0.11
and getting this error:
`Install-Package : NU1101: Unable to find package`
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packag
es
At line:1 char:1
+ Install-Package Microsoft.EntityFrameworkCore -Version 5.0.11
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
I also tried cleaning and building the project several times. The VS2019 I recently just installed.
What might be wrong?
In the Visual Studio go to Tools ► Options. Select NuGet Package Manager. Check that you have Package sources: is including nuget.org set to https://api.nuget.org/v3/index.json:
Then Tools ► NuGet Package Manager ► Manage NuGet Packages for Solution.... Open the Browse tab.
Select nuget.org in the Package source: combo-box:
I developed an ASP.Net MVC web application and It's almost completed. After That, I updated Bootstrap through NuGet package manager to Bootstrap latest stable version 4.3.1 Update was successfully completed. But after the migration following errors are occurred.
Error Build:Cannot find name 'Record'.
Error Build:Cannot find name 'undefined'.
To solve that I installed TypeScript for Visual Studio 2015. Then the above error solved and the following error occurred.
Severity Code Description Project File Line Suppression State
Error The build task could not find node.exe which is required to run
the TypeScript compiler. Please install Node and ensure that the
system path contains its location. ABH.SW.HotelManagement
How can I solve this? I tried to google it for the past 2 days but I wasn't able to find any solution
This is the only post for this problem, so I'll do my bit for those who use Bootstrap 4.3.1, TypeScript, and VS2015.
First, once you create the project and are about to install Bootstrap 4.3.1 through NuGet, don't let Visual Studio manage TypeScript Typings for you. Check no.
Once Bootstrap and stuff is installed, clean the solution: right click on your solution -> clean solution
Next, open NuGet console (Tools → NuGet Package Manager → Package Manager Console), and install TypeScript 3.0 using this command:
Install-Package Microsoft.TypeScript.MSBuild -Version 3.0.0
Close Visual Studio, open it again, and that's it. Took for me a lot of research to find out that several TypeScript versions cause a lot of conflicts and 3.0 is one of those that actually work.
I had the same issue while trying to update to Bootstrap 4 from Visual Studio 2015. What fixed it for me was installing Typescript 2.2 for Visual Studio 2015 (https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.TypeScript22forVisualStudio2015). You may need to uninstall previous versions of Typescript Tools for VS2015 from Programs and Features.
I think Bootstrap 4.3.1 , Typescript , VS2015 has some issues with each other.
[e.g.
Compilation error from Angular and typescript in VS 2015 MVC project
]
My scenario in my project got this error
Error The build task could not find node.exe which is required to run
the TypeScript compiler. Please install Node and ensure that the
system path contains its location. ACC_Cor...
I'm using VS2017 while other team member that has problem using VS2015 with TypeScript Tools for Microsoft Visual Studio 2015 3.2.2.0 installed
He told me that after map project from source control there is and alert message of something like his typescript version is newer. So after some googling I think you should look in to this link for more information
https://github.com/Microsoft/TypeScript/issues/17136
VS2015 - Change TypeScript Version
How to run TypeScript in Visual Studio 2015 without require() or requireJS
tldr;
For Vs2015 + Bootstrap 4.3.1 I solved my issue by
Check project property
Uninstall Typescript
Install Typescript version 3.0 https://www.microsoft.com/en-us/download/details.aspx?id=48593
I am getting the following error while installing the lib.web.mvc.6.8.2 package with VS 2017. It seems there is an issue with the dependency Microsoft.AspNet.Mvc already installed:
PM> Install-Package Microsoft.AspNet.Mvc
Package 'Microsoft.AspNet.Mvc.5.2.3' already exists in project 'MyMVCApplication' Time Elapsed: 00:00:00.6708551
PM> Install-Package Lib.Web.Mvc -Version 6.8.2
Attempting to gather dependency information for package
'Lib.Web.Mvc.6.8.2' with respect to project 'MyMVCApplication',
targeting '.NETFramework,Version=v4.5.2'
Gathering dependency information took 8,86 sec
Attempting to resolve dependencies for package 'Lib.Web.Mvc.6.8.2'
with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Lib.Web.Mvc.6.8.2'
Resolved actions to install package 'Lib.Web.Mvc.6.8.2'
Retrieving package 'Lib.Web.Mvc 6.8.2' from 'nuget.org'. Install
failed. Rolling back...
Package 'Lib.Web.Mvc.6.8.2 : Microsoft.AspNet.Mvc [4.0.0, 6.0.0)' does not exist in project 'MyMVCApplication'
Package 'Lib.Web.Mvc.6.8.2 : Microsoft.AspNet.Mvc [4.0.0, 6.0.0)' does
not exist in folder 'C:\Users\Cyberphil83\documents\visual studio
2017\Projects\MyMVCApplication\packages'
Executing nuget actions took 19,84 ms Install-Package : Could not
install package 'Lib.Web.Mvc 6.8.2'. 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.At line:1 char:1
+ Install-Package Lib.Web.Mvc -Version 6.8.2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
I checked the github of this project, and it looks like it is targeting .NET 4.6:
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
Lib.Web.Mvc.csproj
But your app is targeting 4.5.2.
So you have few options. One of them is to clone/fork this project and compile targeting 4.5.2. Or simply change your app to 4.6 (if possible?).
Since v6.8.0 release Lib.Web.Mvc requires .NET 4.6+ as it requires HTTP/2 support.
There is a v6.7.x branch which is fix-only branch supporting .NET 4.0+.
If you want to stick to .NET 4.5.2 you will have to use latest 6.7.x version:
PM> Install-Package Lib.Web.Mvc -Version 6.7.1
Alternative is to upgrade your project to .NET 4.6+.
I just upgrade my project from Visual Studio from 2010 to 2013 to support Cross-Origin Resource Sharing (CORS) in my WebApi.
Now when I am installing Microsoft.AspNet.WebApi.Cors package from NuGet then I am getting following error.
I am using Visual Studio 2013, Asp.Net MVC 5
PM> Install-Package Microsoft.AspNet.WebApi.Cors
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.Core (≥ 5.2.3 && < 5.3.0)'.
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.Client (≥ 5.2.3)'.
Install-Package : An item with the same key has already been added.
At line:1 char:1
+ Install-Package Microsoft.AspNet.WebApi.Cors
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], ArgumentException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
I had exact the same problem with another NuGet library.
Please try this steps:
1. Updates
Proof if your installed NuGet version is on the newest version
2. Clear cache
Use the NuGet command prompt and clear the cache:
You can list the local caches with this command:
nuget locals all -list
You can clear all caches with this command:
nuget locals all -clear
3. Check cache
The NuGet Cache is simply a folder on your computer, you can proof delete the remaining files manually under %LOCALAPPDATA%\NuGet\Cache.
Or just run this in administrator CMD:
del %LOCALAPPDATA%\NuGet\Cache\*.nupkg /q
The message says the package is already installed.
try uninstall before to re-install:
Uninstall-Package Microsoft.AspNet.WebApi.Cors
If that can help someone else, I tried to follow the steps from Steffen Mangold but that's wasn't working completely.
If you have an assembly error like:
System.Web.Http, Version=5.0.0.0
after doing this command Install-Package Microsoft.AspNet.WebApi.Cors
Try that :
1 - Run this in administrator CMD
del %LOCALAPPDATA%\NuGet\Cache\*.nupkg /q
2 - Run this in the Package manager console
Install-Package Microsoft.AspNet.WebApi
That will install missing assemblies and fix the error.
Check the package source.
Go to tools, click on Nuget Package Manager and click on Package Manager settings.
Then go to Package Sources subsection under the Nuget Package Manager section.
In my case the source was initially pointing to a folder on my local machine.
So just add another package source with the following details.
Name : nuget.org
Source : https://api.nuget.org/v3/index.json
I'm trying to install Castle Windsor 3.0 using NuGet, and it fails with the following message:
PM> Install-Package Castle.Windsor
'Castle.Core (≥ 3.0.0)' not installed. Attempting to retrieve dependency from source...
Done.
Install-Package : Id is required.
Version is required.
Authors is required.
Description is required.
At line:1 char:16
+ Install-Package <<<< Castle.Windsor
+ CategoryInfo : NotSpecified: (:) [Install-Package], ValidationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.Cmdlets.InstallPackageCmdlet
I've tried it both using the command-line (above) and using the Library Package Manager.
My environment is a default MVC3.0 installation, using the web site template, in Visual Studio 2010, with absolutely nothing changed from the defaults.
The error looks like there is something wrong with the package being downloaded from NuGet.
Can anyone shed any light on this? I can work around it with a manual install of Castle Windsor, but would like to use NuGet if possible.
Thanks in advance for any suggestions.
Update NuGet to the latest version. I recently upgraded from 1.3 to 1.6, but had to completely reinstall (as administrator) to get my project working. I think it was for a FluentValidation.MVC3 project I was whipping up.
I had the same problem even having the latest version of NuGet. I had to settle for:
Install-Package Castle.Core -Version 2.5.2