17

I am using VS2012 and every time I reopen VS, the Default project in the NuGet Package Manager console has been reset to what seems like a arbitrary project, and I have to use the dropdown list to reset to the appropriate project.

How can I set (and persist this setting) for the default project for the package manager console?

StuperUser
  • 10,555
  • 13
  • 78
  • 137
  • 2
    Did you ever find a solution to this? I'm on the google hunt right now for the very same thing. – brudert Apr 17 '13 at 16:17
  • 2
    4 years later and still a problem :) – Laoujin Mar 18 '17 at 01:28
  • 2
    Came here by research for the same question. No solution, but workaround is to create your own powershell cmdlet or global variable which can be used in the pmc and has either the update-database -startupprojectname command hardcoded or a global variable which does contain '-startupprojectname ' so it can be used together with update-database and other commands. A reference for creating this only for nuget by using the profile can be found at [msdn](https://learn.microsoft.com/en-us/nuget/tools/package-manager-console#setting-up-a-nuget-powershell-profile) – dsdel Mar 28 '18 at 08:14
  • 2
    Same issue in 2021 – S.C. Feb 21 '21 at 18:02
  • 2
    After 10 years ! this problem still exists ! :-| :-) – Elyas Dolatabadi May 17 '22 at 14:22
  • 1
    Still no solution in 2022 – Satria Janaka Aug 14 '22 at 13:07

1 Answers1

1

As it stated in documentation here Package Manager Console's Default Project is whatever project set as StartUp Project on your solution level. You can control StartUp project using right click on project in solution explorer and choosing Set as StartUp Project:

Choosing startup project from context menu

or from the dropdown in Standard toolbar on top of the window.

Choosing StartUp project from Standard toolbar

Sharif
  • 343
  • 3
  • 12
  • 2
    Yes, but if you have a website, for example, and you want your data in a new class project, you still want your website to be the startup project. – Jonathan Wood Jun 20 '20 at 20:04