question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Errors displayed in editor when referencing F# project on an C# project

See original GitHub issue

Environment data

dotnet --info output:

SDK .NET Core (reflétant tous les global.json) :
 Version:   2.1.300
 Commit:    adab45bf0c

Environnement d'exécution :
 OS Name:     Mac OS X
 OS Version:  10.13
 OS Platform: Darwin
 RID:         osx.10.13-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.1.300/

Host (useful for support):
  Version: 2.1.0
  Commit:  caa7b7e2ba

VS Code version: 1.25.1 C# Extension version: 1.15.2 Ionide-fsharp: 3.23.0 Mono: Mono JIT compiler version 5.4.1.6 (tarball Mon Dec 11 14:59:42 GMT 2017) Visual Studio Community for Mac: 7.5.2 (Build 40)

Steps to reproduce

The exact same steps as #2075 except, it’s on macOS.

Expected behavior

  • The Problem window should display no problems for the solution.
  • The Editor window should display no problems for Program.cs.

Actual behavior

  • The Problem window says, “The name OrderTaking does not exist in the current context.”
  • The Editor window underlines the OrderTaking class in Program.cs, with the same error.

Additional informations:

OmniSharp log;

Starting OmniSharp server at 2018-7-26 20:53:45
    Target: /Users/salimmakouche/Documents/Projects/dotnet/F/Sydel/Sydel.Solution.sln

OmniSharp server started
    Path: /Users/salimmakouche/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/run
    PID: 53760

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on MacOS 10.13.6 (x64)
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 15.0 - "/Users/salimmakouche/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to '/Users/salimmakouche/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 15.0 - "/Users/salimmakouche/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin"
            MSBuildExtensionsPath = /Users/salimmakouche/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild
            BypassFrameworkInstallChecks = true
            CscToolPath = /Users/salimmakouche/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin/Roslyn
            CscToolExe = csc.exe
            MSBuildToolsPath = /Users/salimmakouche/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin
            TargetFrameworkRootPath = /usr/local/Cellar/mono/5.4.1.6/lib/mono/xbuild-frameworks
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/Users/salimmakouche/Documents/Projects/dotnet/F/Sydel'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Initializing in /Users/salimmakouche/Documents/Projects/dotnet/F/Sydel
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Auto package restore: False
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Update workspace context
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Resolving projects references
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in '/Users/salimmakouche/Documents/Projects/dotnet/F/Sydel/Sydel.Solution.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/salimmakouche/Documents/Projects/dotnet/F/Sydel/Sydel.Api.C.Console/Sydel.Api.C.Console.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/salimmakouche/Documents/Projects/dotnet/F/Sydel'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Stdio.Host
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/salimmakouche/Documents/Projects/dotnet/F/Sydel/Sydel.Api.C.Console/Sydel.Api.C.Console.csproj
[info]: OmniSharp.Stdio.Host
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/Users/salimmakouche/Documents/Projects/dotnet/F/Sydel' on host 53738.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/salimmakouche/Documents/Projects/dotnet/F/Sydel/Sydel.Api.C.Console/Sydel.Api.C.Console.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Sydel.Api.C.Console
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/salimmakouche/Documents/Projects/dotnet/F/Sydel/Sydel.Api.C.Console/Sydel.Api.C.Console.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/salimmakouche/Documents/Projects/dotnet/F/Sydel/Sydel.Api.C.Console/Sydel.Api.C.Console.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        Assets file '/Users/salimmakouche/Documents/Projects/dotnet/F/Sydel/Sydel.Api.C.Console/obj/project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.0'. Ensure that restore has run and that you have included 'netcoreapp2.0' in the TargetFrameworks for your project.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file '/Users/salimmakouche/Documents/Projects/dotnet/F/Sydel/Sydel.Api.C.Console/Sydel.Api.C.Console.csproj'.
/Users/salimmakouche/Documents/Projects/dotnet/F/Sydel/Sydel.Api.C.Console/Sydel.Api.C.Console.csproj
/usr/local/share/dotnet/sdk/2.1.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(198,5): Error: Assets file '/Users/salimmakouche/Documents/Projects/dotnet/F/Sydel/Sydel.Api.C.Console/obj/project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.0'. Ensure that restore has run and that you have included 'netcoreapp2.0' in the TargetFrameworks for your project.

[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/salimmakouche/Documents/Projects/dotnet/F/Sydel/Sydel.Api.C.Console/Sydel.Api.C.Console.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/salimmakouche/Documents/Projects/dotnet/F/Sydel/Sydel.Api.C.Console/Sydel.Api.C.Console.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/salimmakouche/Documents/Projects/dotnet/F/Sydel/Sydel.Api.C.Console/Sydel.Api.C.Console.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/salimmakouche/Documents/Projects/dotnet/F/Sydel/Sydel.Api.C.Console/Sydel.Api.C.Console.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/salimmakouche/Documents/Projects/dotnet/F/Sydel/Sydel.Api.C.Console/Sydel.Api.C.Console.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/salimmakouche/Documents/Projects/dotnet/F/Sydel/Sydel.Api.C.Console/Sydel.Api.C.Console.csproj'

Errors marked capture d ecran 2018-07-26 a 21 36 05 But it compile just like normal. capture d ecran 2018-07-26 a 21 36 14

If you need any further information ? Thank you.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
ghostcommented, Nov 11, 2018

Is there a reason mono-devel is needed for projects that are only using the latest dotnet sdk? Is dotnet sdk missing the API’s to build projects?

3reactions
DustinCampbellcommented, Aug 9, 2018

Oh. I see the problem now. The issue is that OmniSharp only includes enough MSBuild logic to handle C# projects. So, when OmniSharp’s standalone MSBuild is used, F# isn’t supported:

[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 15.0 - "/home/dansowter/.vscode-insiders/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin"

Try installing the latest mono-devel package to get more robust MSBuild support: https://www.mono-project.com/download/stable/#download-lin.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unresolved external symbol in object files - c++ - Stack Overflow
Go to Configuration Properties, C/C++, Generate, verify you point to the abc.lib location under Additional Include Directories. Under Linker, Input, make sure ...
Read more >
Errors in C/C++ - GeeksforGeeks
These are errors generated when the executable of the program cannot be generated. This may be due to wrong function prototyping, incorrect ...
Read more >
Linker Tools Error LNK2019 - Microsoft Learn
All about the Microsoft Visual Studio Linker error LNK2019 and how to diagnose and correct it in C and C++ code.
Read more >
Debugging errors - dbt Developer Hub
Learn about errors and the art of debugging them.
Read more >
GNU make
or use our Web-based project management tool, at: ... When make recompiles the editor, each changed C source file must be recompiled.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found