OmniSharp / omnisharp-roslyn

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

$(SolutionName) in project references doesn't get correctly resolved #1882

Open majkinetor opened 4 years ago

majkinetor commented 4 years ago

I am having the issue with missing namespaces on latest everything (Windows 10, vs & msbuild 16.7, vscode 1.47.3, omnisharp is 'latest' and pre-release v1.23.0-beta2 ).

image

Steps to Reproduce

I just open the project in VSCode. Opening it in VS or running it with dotnet CLI works normally.

OmniSharp log

My debug log of omnisharp is here ( 'latest' version)

C# log

Installing C# dependencies... Platform: win32, x86_64 Downloading package 'OmniSharp for Windows (.NET 4.6 / x64)' (35348 KB).................... Done! Validating download... Integrity Check succeeded. Installing package 'OmniSharp for Windows (.NET 4.6 / x64)' Downloading package '.NET Core Debugger (Windows / x64)' (42010 KB).................... Done! Validating download... Integrity Check succeeded. Installing package '.NET Core Debugger (Windows / x64)' Downloading package 'Razor Language Server (Windows / x64)' (50405 KB).................... Done! Installing package 'Razor Language Server (Windows / x64)' Finished

Environment information

VSCode version: 1.47.3 C# Extension: 1.23.0

Dotnet Information .NET Core SDK (reflecting any global.json): Version: 3.1.400 Commit: 035fb2aa2f Runtime Environment: OS Name: Windows OS Version: 10.0.19041 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.1.400\ Host (useful for support): Version: 3.1.6 Commit: 3acd9b0cd1 .NET Core SDKs installed: 3.1.400 [C:\Program Files\dotnet\sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |align-by-regex|janjoerke|1.0.4| |align-mode|Gruntfuggly|0.0.21| |better-align|wwm|1.1.6| |better-toml|bungcip|0.3.2| |Bookmarks|alefragnani|11.3.1| |chat|karigari|0.35.0| |code-settings-sync|Shan|3.4.3| |codestream|CodeStream|8.3.1| |codetour|vsls-contrib|0.0.34| |csharp|ms-dotnettools|1.23.0| |dakara-foldplus|dakara|1.4.1| |emojisense|bierner|0.7.0| |excel-to-markdown-table|csholmq|1.2.2| |filter-lines|earshinov|0.2.0| |gistfs|vsls-contrib|0.1.8| |gitlab-workflow|GitLab|3.2.0| |gitlens|eamodio|10.2.2| |haml|karunamurti|1.3.0| |hexeditor|ms-vscode|1.2.1| |markdown-all-in-one|yzhang|3.2.0| |markdown-checkbox|bierner|0.1.3| |markdown-pdf|yzane|1.4.4| |output-colorizer|IBM|0.1.2| |pdf|tomoki1207|1.1.0| |plantuml|jebbs|2.13.13| |powershell|ms-vscode|2020.6.0| |project-manager|alefragnani|11.1.0| |remote-containers|ms-vscode-remote|0.128.0| |remove-empty-lines|usernamehw|0.0.6| |restructuredtext|lextudio|129.0.0| |ruby|rebornix|0.27.0| |spellright|ban|3.0.52| |swagger-viewer|Arjun|3.0.1| |todo-tree|Gruntfuggly|0.0.178| |vetur|octref|0.26.1| |vscode-autohotkey|slevesque|0.2.2| |vscode-docker|ms-azuretools|1.4.1| |vscode-format-context-menu|lacroixdavid1|1.0.4| |vscode-JS-CSS-HTML-formatter|lonefy|0.2.3| |vscode-postgres|ckolkman|1.1.11| |vscode-ruby|wingrunr21|0.27.0| |vscode-solution-explorer|fernandoescolar|0.3.10| |vscode-sql-formatter|adpyke|1.4.4| |vscode-table-formatter|shuworks|1.2.1| |vscode-textile-preview|GehDoc|1.3.4| |vscode-todo-highlight|wayou|1.0.4| |vscode-xml|redhat|0.13.0| |vscode-yaml|redhat|0.9.1| |vsliveshare|ms-vsliveshare|1.0.2478|;

NOTE: Initially reported here

filipw commented 4 years ago

could you please provide the log from 1.23.0? the linked log is from the older version also, could you provide a repro project?

majkinetor commented 4 years ago

could you please provide the log from 1.23.0?

Here it is: https://gist.github.com/majkinetor/46cb9c6b4fa9d27832bad1d9782c8a4c

also, could you provide a repro project?

Not at the moment.

filipw commented 4 years ago

thanks a lot. unfortunately the log still doesn't show any problems, so it is very difficult to troubleshoot this. if you don't wish to share this project, perhaps you could create a simple repro with this problem and provide that instead.

majkinetor commented 4 years ago

if you don't wish to share this project, perhaps you could create a simple repro with this problem and provide that instead.

Here is the complete code: [removed]

filipw commented 4 years ago

thanks a lot.

the problem is the usage of $(SolutionName) moniker in project references, which we don't resolve correctly - this is likely a bug in our MSBuild project loader. A workaround would be to get rid of $(SolutionName) and using proper names resolves the problem e.g.:

Bildschirmfoto 2020-08-11 um 12 57 46
majkinetor commented 4 years ago

Thanks a lot @filipw for fast and right response, this fixed my problem.