I am trying to update my app's package to be compatible with .NET Framework 4.8
After I execute the Update-Package nuget command, I get an error mentioned in this link
Then after solving that issue, when I execute again the Update-Package, I'm now getting this error:
Executing nuget actions took 10.93 min
Update-Package : This collection is read-only.
At line:1 char:1
+ Update-Package -Reinstall -verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Update-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.UpdatePackageCommand
I don't know where to check this because it didn't say which library or files are affected by this error.
I tried to clean the packages, enabled verbose flag and everything that was suggested to the search but to no luck
Has somebody encountered the same and overcome this issue?
Really need help on this one.
Related
While installing any package from Visual Studio using the Package Manager Console, I get an error - how to resolve it?
PM> Install-Package Microsoft.AspNet.MVC
Install-Package : Unable to find package 'Microsoft.AspNet.MVC' at source ''.
At line:1 char:1
Install-Package Microsoft.AspNet.MVC
CategoryInfo : NotSpecified: (:) [Install-Package], Exception
FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
In output window, it shows these messages:
[Package source] Unable to load the service index for source https://packagesource.
An error occurred while sending the request.
The remote name could not be resolved: 'packagesource'
Please add the package source from the option.
Tool -> Option -> Nuget Package Manager
Add new source and add name as you want and in source for add https://api.nuget.org/v3/index.json. and save it.
I want to use migrations in my EF Core Lib Project.
I installed NuGet packages
Microsoft.EntityFrameworkCore 3.1.4
Microsoft.EntityFrameworkCore.SqlServer 3.1.4
Microsoft.EntityFrameworkCore.Tools 3.1.4
But the Add-Migration command never appeared in the PM console.
When I restarted Visual Studio 2019. There was an error in the PM console:
Package Manager Console Host Version 5.5.0.6473
Type 'get-help NuGet' to see all available NuGet commands.
& : The term 'C:\Users\ruslan.runchev\.nuget\packages\microsoft.entityframeworkcore.tools\3.1.4\tools\init.ps1' is not recognized as the n
ame of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the pa
th is correct and try again.
At line:1 char:45
+ ... rgs+=$_}; & 'C:\Users\ruslan.runchev\.nuget\packages\microsoft.entity ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\ruslan...\tools\init.ps1:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PM>
How can I solve this problem?
I'm taking a course in MVC that was recorded in 2016, so maybe that has to do with this error. It says to open NuGet console and type in "Enable-Migrations" in order to enable Entity Framework. But when I type that I get all sorts of error messages and yes I double-checked to make sure I'm doing everything the instructor is. I tried different versions of EF in Nuget Package Manager and the error messages change but still happen.
PM> Enable-Migrations
Enable-Migrations : Cannot bind argument to parameter 'Path' because it is null.
At line:1 char:1
+ Enable-Migrations
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Enable-Migrations], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Enable-Migrations
First off, why is this even necessary? From what I've seen of EF and LINQ so far I'd rather code in machine language, but in courses I took before that used EF we never had to do "Migrations" before so I'd like to solve this error message but I don't even see the point of it. I thought I read somewhere that Microsoft in its infinite wisdom has changed the way we do migrations but can't find any updated documentation.
Type following command in package manager console.
dir
or
pwd
pwd show you the path of current directory.
dir list down all folders of current directory. if package manager console is not set to project directory, run
cd "YouProjectDirectory"
and run
Enable-Migrations
If you install required packages in this case entitty framework core packages, it will run successfully.
I have been trying to install Crystal Decision version 13.0.3500.0 into my local code But I am getting error like
**Install-Package : Package 'CrystalReports.Engine 13.0.3500' is not found in the following
primary source(s):
'http://abcv.it.vbn.net/repository/nuget-drs-ms,C:\Program Files (x86)\Microsoft
SDKs\NuGetPackages\'. Please verify all your
online package sources are available (OR) package id, version are specified correctly.
At line:1 char:1
+ Install-Package CrystalReports.Engine -Version 13.0.3500
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId :
NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand**
any clue to solve this issue or error? Thanks in advance
I am using Visual Studio 2017 and getting this error:
The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
on this line of code:
using System.Web.Mvc;
that using is needed for resolving SelectListItem on this line of code:
public static List<SelectListItem> VerificationMethod
I would expect adding an assembly reference would easily solve the problem.
Here is what I tried....
I tried adding an assembly reference by right clicking on the project and selecting Add -> Reference. System.Web.Mvc was not in the list of references to add.
Some other SO posts referenced package Microsoft.Aspnet.Mvc as resolving this. That package was not available either.
I tried this on the nuget console:
PM> Install-Package System.Web.mvc
Install-Package : Unable to find package 'System.Web.mvc'
At line:1 char:1
+ Install-Package System.Web.mvc
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
I also tried this:
PM> Install-Package Microsoft.aspnet.mvc
Package 'Microsoft.aspnet.mvc.5.2.6' already exists in project 'MySite'
Time Elapsed: 00:00:00.0549251
PM>
I also tried this:
update-package -reinstall Microsoft.AspNet.Mvc
And got this error:
Install failed. Rolling back...
Package 'EntityFramework 6.1.0' does not exist in project 'DataAccess'
Here is what we did that worked....
deleted all files and folders in the packages folder in the solution.
Ran:
Update-Package -safe -reinstall -IgnoreDependencies
Install-Package Microsoft.AspNet.Mvc -Version 5.2.3.0
Will you please try the following:
In DataAccess Project> References > Right click on system.web.mvc and remove.
Change the project to DataAccess from package manager console, See the image
Then type in package manager console:
Install-Package Microsoft.AspNet.Mvc -Version 5.2.3.0
[EDIT by OP]
This is what I got when I tried this:
PM> Install-Package Microsoft.AspNet.Mvc -Version 5.2.3.0
Attempting to gather dependency information for package 'Microsoft.AspNet.Mvc.5.2.3' with respect to project 'DataAccess', targeting '.NETFramework,Version=v4.5'
Gathering dependency information took 2.37 sec
Attempting to resolve dependencies for package 'Microsoft.AspNet.Mvc.5.2.3' with DependencyBehavior 'Lowest'
One or more unresolved package dependency constraints detected in the existing packages.config file. All dependency constraints must be resolved to add or update packages. If these packages are being updated this message may be ignored, if not the following error(s) may be blocking the current package operation: 'Microsoft.AspNet.Identity.EntityFramework 2.2.1 constraint: Microsoft.AspNet.Identity.Core (>= 2.2.1)', 'Microsoft.AspNet.Identity.EntityFramework 2.2.1 constraint: EntityFramework (>= 6.1.0)'
Resolving dependency information took 0 ms
Resolving actions to install package 'Microsoft.AspNet.Mvc.5.2.3'
Resolved actions to install package 'Microsoft.AspNet.Mvc.5.2.3'
Found package 'Microsoft.AspNet.Mvc 5.2.3' in 'C:\ThePath\packages'.
Found package 'Microsoft.AspNet.Razor 3.2.3' in 'C:\ThePath\packages'.
Found package 'Microsoft.AspNet.WebPages 3.2.3' in 'C:\ThePath\packages'.
Found package 'Microsoft.Web.Infrastructure 1.0.0' in 'C:\ThePath\packages'.
Package 'Microsoft.AspNet.Razor.3.2.3' already exists in folder 'C:\THePath\packages'
Added package 'Microsoft.AspNet.Razor.3.2.3' to 'packages.config'
Successfully installed 'Microsoft.AspNet.Razor 3.2.3' to DataAccess
Package 'Microsoft.Web.Infrastructure.1.0.0' already exists in folder 'C:ThePath\packages'
Install failed. Rolling back...
Package 'Microsoft.Web.Infrastructure.1.0.0' does not exist in project 'DataAccess'
Removed package 'Microsoft.AspNet.Razor.3.2.3' from 'packages.config'
Executing nuget actions took 389.27 ms
Install-Package : Failed to add reference to 'Microsoft.Web.Infrastructure'.
Reference unavailable.
At line:1 char:1
+ Install-Package Microsoft.AspNet.Mvc -Version 5.2.3.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand