Open dalealleshouse opened 3 years ago
As a workaround, you can create a shell script named /usr/share/dotnet/sdk/X.Y.ZZZ/Roslyn/csc.exe
#! /bin/sh
exec dotnet "`dirname \"$0\"`/bincore/csc.dll" "$@"
Update: Although the above gets OmniSharp working, it breaks other things like dotnet build
, which means it's not at all useful.
One thing that does seem to work is to chmod+x .../Roslyn/bincore/csc.dll
, and use the binfmt_misc
kernel facility to specify an interpreter for .Net DLLs. If you have the binfmt-support
package installed, create the file /usr/share/binfmts/dotnet
:
package dotnet
interpreter /usr/bin/dotnet
magic MZ
detector /path/to/dotnet-detector
The dotnet-detector
script should check that the file being executed is actually a .Net assembly. For example:
#! /bin/sh
exec file -b -- "$1" | grep -F "Mono/.Net assembly" 2>/dev/null
Then run sudo update-binfmts --import dotnet
to activate the new configuration.
Issue Description
OmniSharp fails to load projects that reference nuget packages with
RoslynCodeTaskFactory
tasks. The project builds and runs fine but the following error appears in the log file:Steps to Reproduce
For convivence, I created a very simple project that demonstrates the problem: https://github.com/dalealleshouse/omnisharp-demo
Open the project in your editor or choice to see the error (I've tried omnisharp-vim and omnisharp-vscode)
Expected Behavior
OmniSharp should load the project
Actual Behavior
OmniSharp generates an error in the log and does not load the project
Logs
Environment Information
WSL2 running on Windows - ubuntu 20.4 (x64) OmniSharp-Roslyn v1.37.8
Installed SDKs