Package Manage Console not working - c#

I am trying to install Npgsql and Npgsql.EntityFramework and getting this error:
Install-Package : The remote name could not be resolved: 'www.nuget.org'
At line:1 char:16
+ Install-Package <<<< Npgsql
+ CategoryInfo : NotSpecified: (:) [Install-Package], WebException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
What am I doing wrong? Please help

OK this is stupid.
Rebooting my laptop actually helped!
Must have been some wifi network error

Related

Entity Framework gives error "Could not load file or assembly", "FileNotFoundException" every time whenever I reopen visual Studio 2019

I am using visual studio 2019 Ent and EntityFramework.6.4.4.
Whenever I'm restarting my VS19 and going to access EF it gives me the following error with code first approach.
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///("Project Name")\packages\EntityFramework.6.4.4\tools\EntityFramework.PowerShell.Utility.dll' or one of its dependencies. The
system cannot find the file specified."
At "(Project Name)"\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:782 char:5
+ $utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-P ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : FileNotFoundException
You cannot call a method on a null-valued expression.
At "(Project Name)"\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:783 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Exception calling "CreateInstanceFrom" with "8" argument(s): "Could not load file or assembly 'file:///"(Project Name)"\packages\EntityFramework.6.4.4\tools\EntityFramework.PowerShell.dll' or one of its dependencies. The system
cannot find the file specified."
At "(Project Name)"\packages\EntityFramework.6.2.0\tools\EntityFramework.psm1:811 char:5
+ $domain.CreateInstanceFrom(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : FileNotFoundException
What I have tried so far:
I found one temporary solution that by reinstalling every time nugete package i.e entity framework and it works.
But this is annoying and definitely not the solution. Looking for a permanent solution.
Thanks in advance.
In my case I was executing the
Add-Migration
command. Instead, I used
EntityFramework6\Add-Migration
And I had no more errors. (Thanks to this answer I found https://stackoverflow.com/a/58951090/2546759)
Another thing which did the trick was:
Make sure that all projects in the solution are using same EF version.
Restart Visual Studio.
(As suggested here: https://stackoverflow.com/a/70004476/2546759)

Nuget package install command throws error : Install-Package Crystal Decision -Version 13.0.3500

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

Asp.Net boilerplate,, How to Move boilerplate project to another Computer?

I was working on ASP.Net boilerplate framework and now that machine is not available where i was working, But i have backup on my Google drive. How i can use that backup properly? Database creation , project running etc???
I am getting error on Enable-Migrations and Update Database Commands
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///F:\Qubit
Systems\ShipperBuyerV1\module-zero-template-2.1.1\src\packages\EntityFramework.6.1.3\tools\EntityFramework.PowerShell.Utility.dll' or one of its dependencies. Operation is not supported.
(Exception from HRESULT: 0x80131515)"
At F:\Qubit Systems\ShipperBuyerV1\module-zero-template-2.1.1\src\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:780 char:5
+ $utilityAssembly = [System.Reflection.Assembly]::LoadFrom((Join-P ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : FileLoadException
You cannot call a method on a null-valued expression.
At F:\Qubit Systems\ShipperBuyerV1\module-zero-template-2.1.1\src\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781 char:5
+ $dispatcher = $utilityAssembly.CreateInstance(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Exception calling "CreateInstanceFrom" with "8" argument(s): "Could not load file or assembly 'file:///F:\Qubit
Systems\ShipperBuyerV1\module-zero-template-2.1.1\src\packages\EntityFramework.6.1.3\tools\EntityFramework.PowerShell.dll' or one of its dependencies. Operation is not supported. (Exception
from HRESULT: 0x80131515)"
At F:\Qubit Systems\ShipperBuyerV1\module-zero-template-2.1.1\src\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:809 char:5
+ $domain.CreateInstanceFrom(
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : FileLoadException
Here is what you should do:
Download the project from your Google drive
Open in Visual Studio
Run Database-Update (Make sure the Entity Framework project is selected in the Nuget Package Manager.
That is all you need to do to get. All you will lose is the data in your previous database on the unavailable machine.
Best solution is to create a repo in Git, add you project in it. On there PC run git clone on the desired path.
Refer Setting up git repo

Cannot Install Web Grease 1.5.1

When I try to install Web Grease 1.5.1 I get this error:
You cannot call a method on a null-valued expression.
At L:\PROJECT_PATH\packages\WebGrease.1.5.2\tools\install.ps1:45 char:5
+ $msbuild.Xml.AddProperty("WebGreaseLibPath", $relativePackageUri.ToString(). ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Delete all the folders inside the "packages" folder in your application folder. Then try to reinstall web grease from nuget. See if that solves your issue.

Unable to resolve dependency 'html5shiv'

please help me to resolve this error:
PM> Install-Package twitter.bootstrap.mvc4.sample
Attempting to resolve dependency 'twitter.bootstrap.mvc4'.
Attempting to resolve dependency 'html5shiv'.
Install-Package : Unable to resolve dependency 'html5shiv'.
At line:1 char:16
+ Install-Package <<<< twitter.bootstrap.mvc4.sample
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
i want to install twitter.bootstrap.mvc4.samplen.nupkg offline.i add folder path to nuget manager in vs2012.
sorry for my bad english.
Try running Install-Package html5shiv first

Categories

Resources