VS-Code loaded project not showing in default project for package manager console NuGet package

pwbguy 21 Reputation points
2023-02-07T22:40:11.6733333+00:00

I am trying to work on and get a powershell script running that requires the MS Exchange WebServices dll from NuGet, when i try to load the script as a project in VS Code and install the dll as a package from NuGet via the Package Manager Console it gives me the error "Project 'Default' is not found", but there is no package available to be selected in the Default Project dropdown and I have verified that the project is loaded in the Solution Explorer, what am I missing?

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,047 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 43,931 Reputation points
    2023-02-09T15:35:02.02+00:00

    Hi. Thank you for your question and reaching out. I’d be more than happy to help you with your query

    It seems that the NuGet Package Manager Console in Visual Studio Code is not able to find the Default project in your solution. This error can occur if the NuGet Package Manager Console is not able to access the .csproj file of the project.

    You can try the following steps to resolve the issue:

    Make sure that the project you want to install the NuGet package for is the startup project in your solution. You can set the startup project by right-clicking the project in the Solution Explorer and selecting "Set as Startup Project".

    If the project still doesn't show up in the Default Project dropdown in the Package Manager Console, try specifying the project explicitly. You can do this by running the following command in the Package Manager Console:

    PM> Install-Package Microsoft.Exchange.WebServices -ProjectName <ProjectName>

    Replace <ProjectName> with the name of your project.

    If the above steps don't work, try closing and reopening Visual Studio Code and the Package Manager Console, and then repeating the steps above.

    If the issue still persists, it may be related to a problem with the project file or the NuGet Package Manager Console in Visual Studio Code.

    If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.

    0 comments No comments