Questions tagged [package-manager-console]

37 questions
7
votes
2 answers

EF Core set environment not working predictably

When I go to update my database I run $env:ASPNETCORE_ENVIRONMENT="Development" first before executing the Update-Database command to set the correct environment. If I had previously deployed changes to Test for example, running this command should…
5
votes
0 answers

What are the Visual Studio's Package Manager Console (Powershell) limitations?

According to Microsoft Docs Package Manager Console helps with package management. It also allows issuing migration related commands (e.g. Add-Migration). I was fooling around by trying its limits and have noticed that some Powershell commands…
4
votes
1 answer

Is there a way to store a list of commands in Visual Studio for Package Manager Console

We're switching from a classic Desktop application project, where everything fitted nicely within Visual Studio, to an Angular Web Project, where everything seems to be scattered over different environments all over the place. One of the changes is…
4
votes
1 answer

How to use Package Manager Console powershell outside visual studio

I have a powershell script which has nuget commands like: Get-Project -All Get-Package -ProjectName When I run package manager console on visual studio like: PM> .\download-packages-license.ps1 It worked but I cannot run powershell. I need a…
4
votes
3 answers

Entity Framework PowerShell script cannot be loaded by Visual Studio because its operation is blocked by software restriction policies

When I load Package Manager Console within Visual Studio 2017 v15.9.6 in a project that uses Entity Framework I receive the following error: \packages\EntityFramework.6.2.0\tools\init.ps1 cannot be loaded because its operation is blocked by…
2
votes
0 answers

Can't open package manager console in visual studio 2019

I am learning asp .net from this udemy course udemy_course_link. Whenever I open package manager console in visual studio 2019, Following error comes : The error message is: Unable to cast COM object of type 'System.__ComObject' to interface type…
2
votes
5 answers

Why does calling "get-help entityframework" in the Package Manager Console cause this error?

PM> get-help entityframework get-help : Object reference not set to an instance of an object. At line:1 char:1 + get-help entityframework + ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-Help],…
2
votes
1 answer

Package Manager Console vs Nuget.exe build file behavior

I have a .net 4.71 classic project to which I am trying to add nuget package I generated. When I use the Visual Studio package manager cli or interface files get added to the solution. When I add the package via nuget.exe (4.5.1.4879) those files…
1
vote
0 answers

How to execute similar action from Package Manager Console like programmatic Database.EnsureCreated()?

I can execute EF Core's Database.EnsureCreated() programmatically, when my web application starts, and everything EF Core related code in place, and is working properly. Is there any way to execute something similar from PM> console? (just like…
1
vote
1 answer

Any way to detect when DbContext.OnConfiguring() is being called from Package Manager Console?

Is there any way to know if DbContext.OnConfiguring() is being called from the Package Manager? Here's my method. protected override void OnConfiguring(DbContextOptionsBuilder options) { if (string.IsNullOrWhiteSpace(DataPath)) throw new…
1
vote
1 answer

How to fix error when adding an ef core migration through the PMC for mysql?

I want to switch from using SQL Server to MySql. I have already created migrations for SQL Server and have applied them to the DB. I have added the Pomelo Mysql package and now want to create migrations for a MySql db. My problem is that I am…
1
vote
1 answer

running multiple Entity Framework commands one by one

Is it possible to run scripts in Package manager Console to update Entity Framework with multiple commands? I'd want a script like: Update-database -migration oldTragetMigration remove-migration remove-migration add-migration…
Elvis Skensberg
  • 151
  • 1
  • 9
1
vote
1 answer

ABP Update-Database error - The specified framework version '2.1' could not be parsed -

Just trying to create the database as part of the steps in this documentation. Solution builds fine. Message from Package Manager Console: PM> Update-Database The specified framework version '2.1' could not be parsed The specified framework…
1
vote
2 answers

Error when I run update-database in VS 2017 in package manger console

I get this error when i run Update-database command on VS 2017 package manger console . I have Windows server 2016 and install SQL 2016 on that , open all necessary port as 1433 on fire wall, also add sql server.exe to enable from firewall. Ok, In…
1
vote
1 answer

Package manager console in VS 2017 cannot run exe file located in %windir%\system32

A hello world C# x64 application created in Visual Studio 2017 is executed successfully via Package Manager Console (PMC) everywhere else except %windir%\system32 location. The strange thing is that it is executed in Windows PowerShell (not as…
maclaud
  • 182
  • 10
1
2 3