Doesn't work if multiple target frameworks are specified in the csproj
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>
I'm having the same problem.
Same here with net8.0 and net48 multitarget
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.