OmniSharp / omnisharp-roslyn

OmniSharp server (HTTP, STDIO) based on Roslyn workspaces
MIT License
1.76k stars 420 forks source link

1.27.x broke omnisharp-roslyn for a .sln containing a mix of old-sdk and new-sdk projects #1077

Closed razzmatazz closed 6 years ago

razzmatazz commented 6 years ago

Sorry, I cannot provide the .csproj files verbatim as those are company property but I will be able to test.

Anyway, the story is that we have a .sln file that contains a mix of new-sdk and old-sdk-style .csprojs with a mix of net462 and netstandard2.0 framework targets.

It used to work ok with 1.26.3 but when loading the .sln with 1.27.x, codecheck reports that apparently it doesn't see any basic clr types from mscorlib, like, namespace System is missing and System.Enum or System.Int32 are not available too.

Loading a clean non-related .net core project seem to work alright, though..

How should I start figuring this out?

This is on macos 10.13.2, with mono 5.4.1.6 and dotnet 2.0 installed.

Log excerpt from 1.28.0 (which is exactly the same with 1.26.3)

[22:42:48] INFORMATION: OmniSharp.MSBuild.Discovery.MSBuildLocator, Located 1 MSBuild instance(s)
            1: StandAlone 15.0 - "/Users/bob/.emacs.d/.cache/omnisharp/server/v1.28.0/omnisharp/msbuild/15.0/Bin"
[22:42:48] INFORMATION: OmniSharp.MSBuild.Discovery.MSBuildLocator, MSBUILD_EXE_PATH environment variable set to '/Users/bob/.emacs.d/.cache/omnisharp/server/v1.28.0/omnisharp/msbuild/15.0/Bin/MSBuild.dll'
[22:42:48] INFORMATION: OmniSharp.MSBuild.Discovery.MSBuildLocator, Registered MSBuild instance: StandAlone 15.0 - "/Users/bob/.emacs.d/.cache/omnisharp/server/v1.28.0/omnisharp/msbuild/15.0/Bin"
            MSBuildExtensionsPath = /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/xbuild
            CscToolPath = /Users/bob/.emacs.d/.cache/omnisharp/server/v1.28.0/omnisharp/msbuild/15.0/Bin/Roslyn
            CscToolExe = csc.exe
            MSBuildToolsPath = /Users/bob/.emacs.d/.cache/omnisharp/server/v1.28.0/omnisharp/msbuild/15.0/Bin
            TargetFrameworkRootPath = /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/xbuild-frameworks
DustinCampbell commented 6 years ago

@razzmatazz : Could you clarify what you mean by new-sdk and old-sdk-style .csprojs? I'm not sure what you mean by an "old-sdk-style" .csproj.

razzmatazz commented 6 years ago

@DustinCampbell – I meant .csprojs that contain:

<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

vs

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

Not sure what is the right term for this.

But... I cannot replicate this issue anymore with 1.28.0. :) So I think we can close this issue.

And I was wondering at one point,

DustinCampbell commented 6 years ago

At the moment, in the case of multi-TFM (target framework moniker) projects, OmniSharp arbitrarily chooses the first TFM in the list. Eventually, I think we'll want to add end points to make it possible for clients to change the TFM that is considered the current project context.

DustinCampbell commented 6 years ago

Closing this since the issue was fixed in 1.28