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

Doesn't work if multiple target frameworks are specified in the csproj #75

Open
amagee opened this issue Mar 11, 2023 · 3 comments
Open

Comments

@amagee
Copy link

amagee commented Mar 11, 2023

I'm using csharp-ls 0.6.1 via neovim and nvim-lspconfig.

I can reproduce the problem with a project with a single .cs file:

using System;

namespace dotnet
{
  class Program
  {
    static void Main(string[] args)
    {
      var a = args;
    }
  }
}

If my .csproj file contains this:

<TargetFrameworks>net6.0;net7.0</TargetFrameworks>

then the LSP appears to initialise fine - I do not see anything that looks problematic in the logs, but none of the functionality works. Eg. if I have my cursor on the args in var a = args and try go-to-definition, nothing happens, and the logs say that the language server reported "No location found".

However if I replace the TargetFrameworks line in the csproj with any of the following, everything works fine:

<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
@Brent7788
Copy link

I'm having the same problem.

@molostovvs
Copy link

Same here with net8.0 and net48 multitarget

@zachgharst
Copy link

Still having this issue on latest when specifying net6/net8. Any update? If someone can point me in the right direction, I can attempt to help out.

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

No branches or pull requests

4 participants