Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to newer MSBuild on macOS for .NET6 workload resolver support #4417

Closed
Redth opened this issue Mar 3, 2021 · 10 comments · Fixed by OmniSharp/omnisharp-roslyn#2111
Closed

Comments

@Redth
Copy link
Member

Redth commented Mar 3, 2021

Currently on macOS (and presumably Linux) OmniSharp cannot resolve optional workloads in .NET 6.

The version of MSBuild shipping with mono does not have this support (and likely never will). I see that the extension also bundles its own version of MSBuild (which appears to be from VSWin?).

It would be great if this could be updated to align with the MSBuild in VS 16.9 so that the workload resolvers can be enabled to support resolving SDK's from optional workloads to include additional TFM's such as net6.0-android and net6.0-ios.

Today, this is achieved by adding a sentinel file to the right location in the SDK, for example:

sdk/6.0.100-preview.1.21103.13/EnableWorkloadResolver.sentinel

You can find more about how to install the SDK workloads for iOS/Android here:
https://github.com/dotnet/net6-mobile-samples

@filipw
Copy link
Contributor

filipw commented Mar 3, 2021

the bundled MSBuild was updated to 16.9 yesterday to match .NET 6 Preview 1
OmniSharp/omnisharp-roslyn#2103

We plan to release a new version of OmniSharp server today

@Redth
Copy link
Member Author

Redth commented Mar 3, 2021

Thanks @filipw ! What's the path to using that update in vscode once the server update is released? Is there a way I can help test?

@filipw
Copy link
Contributor

filipw commented Mar 3, 2021

you can set "omnisharp.path":"latest" to opt into the latest pre-releases of the server component

@Redth
Copy link
Member Author

Redth commented Mar 4, 2021

@filipw I've updated and I'm still having trouble getting it to pick up the new workload resolver. This was the same for 1.37.7 on another Mac, even though this one I've got the 1.37.8-beta2 (I did check to verify MSBuild from 16.9 series on 1.37.8-beta2).

I'm trying to load a project from this repo: https://github.com/dotnet/net6-mobile-sample

The workload resolver is supposed to be enabled by adding the file in the sdk, for example:

/usr/local/share/dotnet/sdk/6.0.100-preview.1.21103.13/EnableWorkloadResolver.sentinel

For some reason it's not picking it up and so the TargetPlatformIdentifier android is not recognized.

Here's my omnisharp logs:

Starting OmniSharp server at 3/4/2021, 5:00:19 PM
    Target: /Users/redth/Desktop/mauivscodesample

OmniSharp server started.
    Path: /Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/run
    PID: 52870

[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Cake, Version=1.37.0.0, Culture=neutral, PublicKeyToken=null
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.DotNetTest, Version=1.37.0.0, Culture=neutral, PublicKeyToken=null
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Host, Version=1.37.0.0, Culture=neutral, PublicKeyToken=null
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.MSBuild, Version=1.37.0.0, Culture=neutral, PublicKeyToken=null
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Roslyn, Version=1.37.0.0, Culture=neutral, PublicKeyToken=null
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Roslyn.CSharp, Version=1.37.0.0, Culture=neutral, PublicKeyToken=null
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Script, Version=1.37.0.0, Culture=neutral, PublicKeyToken=null
[dbug]: OmniSharp.CompositionHostBuilder
        Loaded OmniSharp.Shared, Version=1.37.0.0, Culture=neutral, PublicKeyToken=null
[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on MacOS 11.2.2 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[dbug]: OmniSharp.CompositionHostBuilder
        .NET SDK requires MSBuild instances version 16.7.0 or higher
[dbug]: OmniSharp.MSBuild.Discovery.Providers.MonoInstanceProvider
        Can't use installed Mono because OmniSharp isn't running on it
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 16.9.0 - "/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin"
[dbug]: OmniSharp.CompositionHostBuilder
        MSBuild instance StandAlone 16.9.0 scored at 1
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        SUCCESS: Resolved to '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.Build.dll' (name-only).
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        SUCCESS: Resolved to '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.Build.Utilities.Core.dll' (name-only).
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        SUCCESS: Resolved to '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.Build.Framework.dll' (name-only).
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        SUCCESS: Resolved to '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.Build.Tasks.Core.dll' (name-only).
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 16.9.0 - "/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin"
            CscToolExe = csc.exe
            MSBuildToolsPath = /Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin
            CscToolPath = /Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Roslyn
            BypassFrameworkInstallChecks = true
            MSBuildExtensionsPath = /Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.VisualBasic.Workspaces, Version=3.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.VisualBasic.Features, Version=3.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.VisualBasic.Features.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.Workspaces.resources, Version=3.10.0.0, Culture=en-CA, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.Workspaces.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.Workspaces.resources, Version=3.10.0.0, Culture=en, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.Workspaces.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.CSharp.Workspaces.resources, Version=3.10.0.0, Culture=en-CA, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.CSharp.Workspaces.resources, Version=3.10.0.0, Culture=en, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.Workspaces.resources, Version=3.10.0.0, Culture=en-CA, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.Workspaces.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.Workspaces.resources, Version=3.10.0.0, Culture=en, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.Workspaces.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.CSharp.Features.resources, Version=3.10.0.0, Culture=en-CA, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.CSharp.Features.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.CSharp.Features.resources, Version=3.10.0.0, Culture=en, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.CSharp.Features.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.Features.resources, Version=3.10.0.0, Culture=en-CA, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.Features.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.Features.resources, Version=3.10.0.0, Culture=en, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.Features.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.CSharp.Features.resources, Version=3.10.0.0, Culture=en-CA, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.CSharp.Features.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.CSharp.Features.resources, Version=3.10.0.0, Culture=en, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.CSharp.Features.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.CSharp.Features.resources, Version=3.10.0.0, Culture=en-CA, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.CSharp.Features.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.CSharp.Features.resources, Version=3.10.0.0, Culture=en, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.CSharp.Features.resources.dll'.
[dbug]: OmniSharp.WorkspaceInitializer
        Starting with OmniSharp options: {"RoslynExtensionsOptions":{"EnableDecompilationSupport":false,"EnableAnalyzersSupport":true,"EnableImportCompletion":false,"DocumentAnalysisTimeoutMs":10000,"LocationPaths":null},"FormattingOptions":{"OrganizeImports":false,"EnableEditorConfigSupport":true,"NewLine":"\n","UseTabs":false,"TabSize":4,"IndentationSize":4,"SpacingAfterMethodDeclarationName":false,"SpaceWithinMethodDeclarationParenthesis":false,"SpaceBetweenEmptyMethodDeclarationParentheses":false,"SpaceAfterMethodCallName":false,"SpaceWithinMethodCallParentheses":false,"SpaceBetweenEmptyMethodCallParentheses":false,"SpaceAfterControlFlowStatementKeyword":true,"SpaceWithinExpressionParentheses":false,"SpaceWithinCastParentheses":false,"SpaceWithinOtherParentheses":false,"SpaceAfterCast":false,"SpacesIgnoreAroundVariableDeclaration":false,"SpaceBeforeOpenSquareBracket":false,"SpaceBetweenEmptySquareBrackets":false,"SpaceWithinSquareBrackets":false,"SpaceAfterColonInBaseTypeDeclaration":true,"SpaceAfterComma":true,"SpaceAfterDot":false,"SpaceAfterSemicolonsInForStatement":true,"SpaceBeforeColonInBaseTypeDeclaration":true,"SpaceBeforeComma":false,"SpaceBeforeDot":false,"SpaceBeforeSemicolonsInForStatement":false,"SpacingAroundBinaryOperator":"single","IndentBraces":false,"IndentBlock":true,"IndentSwitchSection":true,"IndentSwitchCaseSection":true,"IndentSwitchCaseSectionWhenBlock":true,"LabelPositioning":"oneLess","WrappingPreserveSingleLine":true,"WrappingKeepStatementsOnSingleLine":true,"NewLinesForBracesInTypes":true,"NewLinesForBracesInMethods":true,"NewLinesForBracesInProperties":true,"NewLinesForBracesInAccessors":true,"NewLinesForBracesInAnonymousMethods":true,"NewLinesForBracesInControlBlocks":true,"NewLinesForBracesInAnonymousTypes":true,"NewLinesForBracesInObjectCollectionArrayInitializers":true,"NewLinesForBracesInLambdaExpressionBody":true,"NewLineForElse":true,"NewLineForCatch":true,"NewLineForFinally":true,"NewLineForMembersInObjectInit":true,"NewLineForMembersInAnonymousTypes":true,"NewLineForClausesInQuery":true},"FileOptions":{"SystemExcludeSearchPatterns":["**/node_modules/**/*","**/bin/**/*","**/obj/**/*","**/.git/**/*","**/.git","**/.svn","**/.hg","**/CVS","**/.DS_Store"],"ExcludeSearchPatterns":[]},"RenameOptions":{"RenameOverloads":false,"RenameInStrings":false,"RenameInComments":false},"ImplementTypeOptions":{"InsertionBehavior":null,"PropertyGenerationBehavior":null},"Plugins":{"LocationPaths":null}}
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.CSharp.Workspaces.resources, Version=3.10.0.0, Culture=en-CA, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.CodeAnalysis.CSharp.Workspaces.resources, Version=3.10.0.0, Culture=en, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll'.
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/Users/redth/Desktop/mauivscodesample'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[dbug]: OmniSharp.MSBuild.ProjectSystem
        MSBuild environment: 
Mode: Standalone
RunningTests: False
RunningInVisualStudio: False
MSBuildToolsDirectory32: /Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin
MSBuildToolsDirectory64: /Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin
MSBuildSDKsPath: /Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Sdks
CurrentMSBuildConfigurationFile: /Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/MSBuild.exe.config
CurrentMSBuildExePath: /Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/MSBuild.exe
CurrentMSBuildToolsDirectory: /Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin
VisualStudioInstallRootDirectory: 
MSBuildExtensionsPath: /Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin

[dbug]: OmniSharp.MSBuild.ProjectLoader
        'MSBuildExtensionsPath' set to '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild'
[dbug]: OmniSharp.MSBuild.ProjectLoader
        'CscToolPath' set to '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Roslyn'
[dbug]: OmniSharp.MSBuild.ProjectLoader
        'CscToolExe' set to 'csc.exe'
[info]: OmniSharp.MSBuild.ProjectSystem
        No solution files found in '/Users/redth/Desktop/mauivscodesample'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/redth/Desktop/mauivscodesample/mauivscodesample.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/redth/Desktop/mauivscodesample'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/Users/redth/Desktop/mauivscodesample' on host 52844.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/redth/Desktop/mauivscodesample/mauivscodesample.csproj
[dbug]: OmniSharp.Stdio.Host
        ************ Request ************
{
  "Type": "request",
  "Seq": 1,
  "Command": "/projects"
}
[dbug]: OmniSharp.Stdio.Host
        ************ Request ************
{
  "Type": "request",
  "Seq": 2,
  "Command": "/projects"
}
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.Build.resources, Version=15.1.0.0, Culture=en-CA, PublicKeyToken=b03f5f7f11d50a3a'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.Build.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.NET.Build.Tasks.resources, Version=6.0.4.10313, Culture=en-CA, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.NET.Build.Tasks.resources.dll'.
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Attempting to resolve 'Microsoft.NET.Build.Tasks.resources, Version=6.0.4.10313, Culture=en, PublicKeyToken=31bf3856ad364e35'
[dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        FAILURE: Could not locate '/Users/redth/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.8-beta.2/omnisharp/.msbuild/Current/Bin/Microsoft.NET.Build.Tasks.resources.dll'.
[fail]: OmniSharp.MSBuild.ProjectLoader
        The target platform identifier android was not recognized.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file '/Users/redth/Desktop/mauivscodesample/mauivscodesample.csproj'.
/Users/redth/Desktop/mauivscodesample/mauivscodesample.csproj
/usr/local/share/dotnet/sdk/6.0.100-preview.1.21103.13/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(109,5): Error: The target platform identifier android was not recognized.

[fail]: OmniSharp.MSBuild.ProjectManager
        Attempted to update project that is not loaded: /Users/redth/Desktop/mauivscodesample/mauivscodesample.csproj
[dbug]: OmniSharp.Stdio.Host
        ************  Response ************ 
{
  "Request_seq": 2,
  "Command": "/projects",
  "Running": true,
  "Success": true,
  "Message": null,
  "Body": {
    "MsBuild": {
      "SolutionPath": "/Users/redth/Desktop/mauivscodesample",
      "Projects": []
    },
    "Script": {
      "Projects": []
    }
  },
  "Seq": 79,
  "Type": "response"
}
[dbug]: OmniSharp.Stdio.Host
        ************  Response ************ 
{
  "Request_seq": 1,
  "Command": "/projects",
  "Running": true,
  "Success": true,
  "Message": null,
  "Body": {
    "MsBuild": {
      "SolutionPath": "/Users/redth/Desktop/mauivscodesample",
      "Projects": []
    },
    "Script": {
      "Projects": []
    }
  },
  "Seq": 80,
  "Type": "response"
}
[dbug]: OmniSharp.Stdio.Host
        ************ Request ************
{
  "Type": "request",
  "Seq": 3,
  "Command": "/projects"
}
[dbug]: OmniSharp.Stdio.Host
        ************  Response ************ 
{
  "Request_seq": 3,
  "Command": "/projects",
  "Running": true,
  "Success": true,
  "Message": null,
  "Body": {
    "MsBuild": {
      "SolutionPath": "/Users/redth/Desktop/mauivscodesample",
      "Projects": []
    },
    "Script": {
      "Projects": []
    }
  },
  "Seq": 94,
  "Type": "response"
}

@JoeRobich
Copy link
Member

@Redth The C# extension ships with a minimal version of mono and msbuild. It should support console and and razor projects out of the box. However, android is not presently supported by the extension.

cc: @cartermp

@ghost
Copy link

ghost commented Apr 28, 2022

@JoeRobich I installed the maui rc2 workload on MacOS. On vscode, Omnisharp does not seem to be resolving platform specific using directives, with errors like:

The type or namespace name 'UIKit' could not be found (are you missing a using directive or an assembly reference?)

Could you confirm if omnisharp currently supports maui projects, and if not, when can we hope to have that support? I've opted-in to use the latest server version. Right now, it is: OmniSharp for OSX (.NET 6 / arm64), Version = 1.38.3-beta.67

Thanks!

@JoeRobich
Copy link
Member

JoeRobich commented Apr 29, 2022

@cfierro-glb I was able to get the WeatherTwentyOne sample app loaded with no error on my M1 Mac by performing the following steps (referencing https://github.com/dotnet/maui/wiki/macOS-Install).

{
  "sdk": {
    "version": "6.0.300"
  }
}
  • Install the maui workload using the commandline
> sudo dotnet workload install maui --source https://api.nuget.org/v3/index.json
  • Update the WeatherTwentyOne csproj to make the 'net6.0-ios' the first listed target framework (O# only loads the first target when multi-targeting)
  • Restart the OmniSharp Server
  • Update the GlobalUsings.cs
- global using Microsoft.Maui.Essentials;
+ global using Microsoft.Maui.Devices;
+ global using Microsoft.Maui.ApplicationModel;

Maybe you can see if it will load for you as well.

@ghost
Copy link

ghost commented Apr 29, 2022

@JoeRobich Thanks for your response. I did all the steps before, but missed the one that fixed my issue:
Update the csproj to make the 'net6.0-ios' the first listed target framework (O# only loads the first target when multi-targeting)

With this in mind, are there plans for O# to load all targets of a multi-target projects in the future?

@JoeRobich
Copy link
Member

With this in mind, are there plans for O# to load all targets of a multi-target projects in the future?

It is certainly a highly requested feature - #3754. I think long term we will need better support for it. We will just have to see how that gets worked into the road map.

@ghost
Copy link

ghost commented Apr 29, 2022

Thanks for the link. I've subscribed for any updates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants