NuGet / Home

Repo for NuGet Client issues
Other
1.49k stars 252 forks source link

Project "Default" is not found #1215

Closed maartenba closed 6 years ago

maartenba commented 9 years ago

From @swiftie821 on August 18, 2015 15:43

NuGet is not letting me install packages or change the current project in command line, keeps coming up with (on Get-Package -ListAvailable):

PM> Get-Package -ListAvailable Get-Package : Project 'Default' is not found. At line:1 char:12

Using VS2015RC2 NuGet version: 4.6.00081

Copied from original issue: NuGet/NuGetGallery#2635

yishaigalatzer commented 9 years ago

This might be related to having solution level packages that are no longer supported.

@swiftie821 can you provide some more details on your solution setup (project types, packages.configs, nuget.config etc.)

yishaigalatzer commented 8 years ago

We didn't hear anything back. Closing for now

obeleh commented 8 years ago

I have the same with a fresh install of vs 2015 professional

Microsoft Visual Studio Professional 2015
Version 14.0.24720.00 Update 1
Microsoft .NET Framework
Version 4.6.01038

Installed Version: Professional

Visual Basic 2015   00322-40000-00000-AA964
Microsoft Visual Basic 2015

Visual C# 2015   00322-40000-00000-AA964
Microsoft Visual C# 2015

Visual C++ 2015   00322-40000-00000-AA964
Microsoft Visual C++ 2015

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11106.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.30624.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.5
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GitHub.VisualStudio   1.0
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

Python Tools for Visual Studio   2.2.31124.00
Python Tools for Visual Studio provides IntelliSense, projects, templates, Interactive windows, and other support for Python developers.

Python Tools for Visual Studio - Django Integration   2.2.31124.00
Provides templates and integration for the Django web framework.

Python Tools for Visual Studio - Profiling Support   2.2.31124.00
Profiling support for Python projects.

SQL Server Data Tools   14.0.50616.0
Microsoft SQL Server Data Tools

TypeScript   1.7.6.0
TypeScript for Microsoft Visual Studio

I'm currently trying to get my python project to work in visual studio.

sanjeets commented 8 years ago

Do we have a solution for this issue? I am having the same problem with visual studios 2015

zhili1208 commented 8 years ago

@sanjeets Can you provide more details about this issue? (nuget version, visual studio version, repro steps, project type, packages.config or project.json, nuget.config)

prakhar241 commented 8 years ago

Even applying package at project level not working -

PM> Install-Package xunit.runner.utility -Version 2.1.0 Install-Package : Project 'Default' is not found. At line:1 char:1

PM>

zhili1208 commented 8 years ago

@prakhar241 Can you provide more information? visual studio Version? NuGet Version? project type?

hesantan commented 8 years ago

Happening to me also, VS 2015 Professional: image

Nuget Version: image

Web project. ASP.NET - Web Forms

prakhar241 commented 8 years ago

There are some steps written by @bitpen here - http://stackoverflow.com/questions/10130333/cant-install-packages-with-nuget-500-internal-server-error

1.) Run VS in admin mode. 2.) Uninstall NuGet from Tools->Extension Manager 3.) Delete everything in C:\Users\AppData\Roaming\NuGet 4.) Reinstall NuGet

These worked for me at least for project level package installation. Thanks.

rrelyea commented 8 years ago

@zhili1208 noticed that several of the repros were with VS2015 Pro. Perhaps that is something to try, repro wise.

zhili1208 commented 8 years ago

I can't repro this issue with VS2015 Pro, if Default Project is null, that means NuGetProject Initialization fail, have no idea unless get an repro.

zhili1208 commented 8 years ago

@sanjeets @prakhar241 @hesantan Do you have any repro steps which I can try? what's your solution structure? are there any packages already installed in any projects? If you could provide a repro app, it will be very helpful, thanks

hesantan commented 8 years ago

@zhili1208 I don't really have a reliable repro, but I think my setup or some other setting might have been might be part of the problem.

Ss I have VS 2013 Professional and I have been using it with NuGet for a while with no problem. I installed VS 2015 Professional not so long ago and I stalled all of the extensions I need along with NuGet.

I have a website set up with a local Nuget Server. I have JWT, Raygun, JSON.Net and two other propiaetary packages from our local server.

I upgraded my solution to VS 2015 and it might have fix my problem.

image

zhili1208 commented 8 years ago

@hesantan we had issues with web site project in nuget 3.4.X, but we fixed it later, so please update VS and nuget to latest, it might fix this

hesantan commented 8 years ago

@zhili1208 My issues have been fixed. Thank you!

Murarka commented 8 years ago

Hello, Am facing this issue with VS 2015 while trying to use create SSIS package to load data to Azure Blob storage. First I get the below error: [Azure Blob Upload Task] Error: Upload task has stopped with exception: Could not load file or assembly 'Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Then when i try to install the Microsoft.Data.Services.Client package from Package Manager console it says Project 'Default' is not found. I can see that the Default Project is empty in Package Manager Console, and does not have any values to select from.

Can someone please help. Thank You

BobFrankston commented 8 years ago

I'm having the same problems with my TypeScript apps but nuget seems to be fine for C#. How can I figure out what is happening? Did the Admin uninstall/install and renamed the NUGet app directory. Think I"m running the latest everything.

hesantan commented 8 years ago

I had this issue again.

This is my repo:

  1. Clean installation of VS 2015 on a new machine.
  2. Installed NuGet extension through website instead of extension manager.
  3. Opened website project that uses private NuGet server.
  4. Added private NuGet source.
  5. Updated source packages
  6. Attempted to update sources through UI and it says the configuration is invalid
  7. Attempted to update sources through manager console and it shows the error Project 'Default' is not found.

This is how I fixed it:

  1. Made VS 2015 always run as admin.
  2. Uninstalled NuGet extension
  3. Remove everything from C:\Users[USERNAME]\AppData\Roaming\NuGet except the config
  4. Updated C:\Users[USERNAME]\AppData\Roaming\NuGet\NuGet.xml with a element pointing to my private NuGet server.
  5. Reinstalled NuGet extension through VS

Hopefully this helps.

zhili1208 commented 8 years ago

this issue is related to creating nugetProject type, it can be DTEProjectCache Initialization failed or passed wrong project name. Since I can't repro this, it's hard to see what's the real issue here. I think we should improve logging here first, the error message "configuration is invalid" is incorrect, we should provide project name, all projects in cache when default project is null. Then we can know what happens here. https://github.com/NuGet/Home/issues/3299

yishaigalatzer commented 8 years ago

I believe Justin was hitting this locally as well. Can you please follow up with him?

SQLGuyChuck commented 8 years ago

I had this issue of Project 'Default' is not found when trying to install local or remote nuget packages when using a database project. I did the reinstall idea and didn't help. I had to add a console application and then was able to install the package.

My solution file had just the .sqlproj project and was failing. Just adding the console .csproj project enabled me to add the package.

Microsoft Visual Studio Solution File, Format Version 12.00

Visual Studio 14

VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "SQLExportCLR", "SQLExportCLR\SQLExportCLR.sqlproj", "{F5E879F1-D88D-4622-870A-5DEDD3CE86FD}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApplication1", "ConsoleApplication1\ConsoleApplication1.csproj", "{D2F1E54B-01FA-4A3C-9566-07BFD20CD416}" EndProject

I am using nuget 3.4.4.1321

zhili1208 commented 8 years ago

@SQLGuyChuck that's because sql project is not supported by nuget now, if you open NuGet UI, NuGet will show a message "this project is not supported", we should send a better message for powershell too.

yishaigalatzer commented 8 years ago

@zhili1208 can we add a good error message in the sql case?

zhili1208 commented 8 years ago

Yes, I will add a good error message in https://github.com/NuGet/Home/issues/3299

DavidTurton commented 7 years ago

I got this error on an ASP.NET Core MVC site using Visual Studio 2015 Update 3 with .NET Core 1.0.1. I was trying to generate my models and context from an existing database, using "scaffold-dbcontext" in Package Manager's console

Turned out that Package Manager does a build before doing anything like this, and I had build errors in the project. Fixed the build errors, problem went away.

ezra100 commented 7 years ago

This worked for me on VS2017:

  1. Closing VS
  2. Going to AppData/Roaming and deleting Nuget
  3. Going to AppData/Local and deleting Nuget
  4. Reopening VS with the solution.
JohnLBevan commented 7 years ago

I received the same issue when working with a PowerShell project. It seems that this issue has its own bug: https://github.com/NuGet/Home/issues/4083 Mentioning here to associate the threads / in case it's the project template that causes the issue, rather than NuGet itself.

PowerShell Project Template from extension: https://marketplace.visualstudio.com/items?itemName=AdamRDriscoll.PowerShellToolsforVisualStudio2015

m3dbedb commented 7 years ago

Same happens to me after deleting "applications insigth for VS2015". Installing AI for VS 2015 fixed the issue.

jswagger commented 6 years ago

Closing out of VS, then reopening with the Package Manager Console open prompted for a "Restore", which then fixed it for me.

dhmorrison commented 6 years ago

In my case I think it is an issue with the type of project I am working on. I can reproduce the can't find 'Default' symptom if I try installing packages when I have a good old "LightSwitch" solution opened in VS 2015. If I then open a .net Core solution in VS 2015, the "symptom" mysteriously vanishes, and I suppose the 'Default' is found....and Package Manager Console chugs along and installs packages like a good package manager should.

nkolev92 commented 6 years ago

Can anyone reproduce this issue on VS 2017? I wasn't able to get a repro on it.

At this point we do not plan on releasing an update for VS2015. Please try latest VS2017 and let us know if you need more help from us.

krshortr commented 6 years ago

I'm getting this error in VS 2017 when trying to install a package to an Integration Services project. The default project dropdown in Package Manager is empty.

krshortr commented 6 years ago

Update to my previous post. The package I'm trying to install contains the new SMO objects for SQL2017, which need to be applied directly to the script task that is executing them, NOT at the project level. My apologies for the spam post!

Stanzilla commented 6 years ago

I still get this error in 15.5 when trying to link a vcpkg file (https://vcpkg.readthedocs.io/en/latest/users/integration/)

AlexHimself commented 6 years ago

I'm having the same issue as @JohnLBevan described for PowerShell and VS2015.

DoctorBearPhD commented 6 years ago

@jswagger 's solution worked for me in VS2017.

anthonypants commented 6 years ago

I'm having the same issue as @krshortr above, both with the Integration Services project and the SQL Server Database project types: in VS2017, the Install-Package and Get-Package commands error out. The "Default project" drop-down in the Package Manager Console is empty, and there are no entries in it. When I right-click the solution in Solution Explorer, the "Manage NuGet Packages for Solution..." and "Restore NuGet Packages" options are greyed out, so I don't even think I can add .nupkg files manually.

If I create a new project using a different type, NuGet works as expected. Is this an issue with the SSIS and MSSQL project types not referencing NuGet properly, or vice versa? Is this intended behavior?

Hypenate commented 5 years ago
  1. I 'unloaded' a project
  2. Then in the Package Manager Console I typed: update-package -reinstall
  3. The error came
  4. I did 'Reload Project'
  5. Repeated step 4
  6. Success
alexbk66 commented 5 years ago

Yeah, above worked for me, assuming step 5 is "Repeated step 2"

catharsis99 commented 4 years ago

I still have this problem. I use Visual Studio Community 2015. I managed to install NuGet package manager. I created one new project. Type of the project is Report Server Project (Business Intelligence). When I open project, and click on Manage NuGet Packages error message is shown "Operation failed. The project "Test project" is unsupported."

I wanted to install QR Coder library https://www.nuget.org/packages/QRCoder/. When I open NuGet Package Manager Console, the Default project field is not automatically populated with current project name. When I try to execute command Install-Package QRCoder -Version 1.3.6, I am getting error message Project "Default" is not found.

The only time I managed to install this library is when I created new project with type Console Application.

If I understand well, my current project type (Report Server project) does not support installing NuGet packages?

This is link that I found: https://stackoverflow.com/questions/43336003/vs2017-nuget-get-package-listavailable-fails-once-solution-opened