Skip to content

OmniSharp cannot handle multiple csproj files in one directory #3359

@fishfood34

Description

@fishfood34

Issue Description

.sln files have .csproj projects added to them, but instead of running

cd <Path to folder containing .csproj>
dotnet restore <filename>.csproj

it appears to be running

cd <Path to folder containing .csproj>
dotnet restore

Steps to Reproduce

  1. Create a directory with more than one .csproj file
  2. Create a .sln file that inclues one of those .csproj files
  3. Configure omni shart to use that .sln file
  4. Open VSCode such that it will run omnisharp using that .sln file

Expected Behavior

OmniSharp runs dotnet restore on the specific .csproj file that is in the .sln file

Actual Behavior

OmniShapr runs dotnet restore in the directory that contains both .csproj files throwing the following error:

MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.
Done: 1.

Environment information

VSCode version: 1.39.1
C# Extension: 1.21.5

Mono Information OmniSharp using built-in mono
Dotnet Information .NET Core SDK (reflecting any global.json): Version: 2.2.401 Commit: 729b316c13

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.14
OS Platform: Darwin
RID: osx.10.14-x64
Base Path: /usr/local/share/dotnet/sdk/2.2.401/

Host (useful for support):
Version: 2.2.6
Commit: 7dac9b1b51

.NET Core SDKs installed:
2.2.401 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

Visual Studio Code Extensions
Extension Author Version
csharp ms-vscode 1.21.5
dotenv mikestead 1.0.1
dotnet-test-explorer formulahendry 0.7.1
Go ms-vscode 0.11.7
mssql ms-mssql 1.6.0
python ms-python 2019.10.41019
vscode-docker ms-azuretools 0.8.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions