-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
omnisharp-roslyn cannot find Microsoft.Common.props #126477
Comments
I tried overriding the installPhase = ''
mkdir -p $out/bin
cd ..
cp -r src $out/
rm -r $out/src/.msbuild
cp -r ${msbuild}/lib/mono/msbuild $out/src/.msbuild
chmod -R u+w $out/src
mv $out/src/.msbuild/Current/{bin,Bin}
# this line is new:
cp -r src/.msbuild/Current/Microsoft.Common.props $out/src/.msbuild/Current
makeWrapper ${mono}/bin/mono $out/bin/omnisharp \
--add-flags "$out/src/OmniSharp.exe"
''; I don't get the original error anymore, but now
|
Could you share the project you're using to reproduce this? Also, I'm locally using this change: #126487, which may be worth trying. |
Ah, in the PR you're also copying I can't share the entire project. Perhaps the project's let sources = import ./nix/sources.nix;
in { pkgs ? import sources.nixpkgs { } }:
with pkgs;
with lib;
let
dotnet-combined = with dotnetCorePackages; combinePackages [ sdk_5_0 ];
dotnetRoot = "${dotnet-combined}";
dotnetSdk = "${dotnet-combined}/sdk";
dotnetBinary = "${dotnetRoot}/bin/dotnet";
in mkShell {
name = "env";
buildInputs = [ dotnet-combined ];
shellHook = ''
export DOTNET_ROOT=${escapeShellArg dotnetRoot}
local dotnetBase=${escapeShellArg dotnetSdk}/$(${
escapeShellArg dotnetBinary
} --version)
export MSBuildSdksPath=$dotnetBase/Sdks
export MSBUILD_EXE_PATH=$dotnetBase/MSBuild.dll
'';
} I also tried disabling |
I was able to reproduce this issue with a new .NET project created by |
The PR mentioned before has been merged now; maybe that will help you @felschr ? |
So, first of all I noticed that omnisharp was partially working before. The autocompletion seemed to mostly work for local variables & basic system libraries (e.g. I noticed some new errorrs in the
I've updated https://github.com/felschr/omnisharp-nix-issue with the new omnisharp. E.g. in note: sorry for the closing, reopening & multiple messages. GitHub showed me some popup that I couldn't close, and I accidentally closed the issue somehow while trying to close the popup 😅. |
Adding |
We do have msbuild 16.8, but that doesn't seem to be sufficient.
I'm not sure about the reference assemblies. We could try upgrading mono, but perhaps there's another way to acquire them? |
I tried upgrading mono to 6.13 nightly, but it doesn't have .net 5 assemblies in |
I thought So, I tried passing my specific dotnet package to omnisharp-roslyn =
pkgs.omnisharp-roslyn.override { dotnet-sdk = dotnet-combined; }; This seems to allow omnisharp to find the SDK assemblies, but now it complains about
|
Yeah, there's some interaction between msbuild and the dotnet sdk that I don't fully understand. Just investigating... |
I think msbuild is supposed to find the reference assemblies from installed dotnet SDKs. But I also don't understand how it's trying to find those files and how omnisharp might interfere with that. I think to avoid having to override |
it was needed in $PATH because it expects the |
I still think it should be up to the user to make sure it's in the PATH. Usually when installing dotnet it via nix-env, NixOS or home-manager that should happen automatically. |
I don't use the dotnet sdk at all for my project, so I don't want it in my environment, but without it in the PATH for omnisharp, omnisharp will currently fail. If they support running omnisharp without it, I agree that it should be removed. |
I'd be fine with using I've just found this dotnet/roslyn#53906 (comment) regarding the NuGet error.
|
I just pushed #132165 with some changes that seem to fix your test project, and still work on my project. I still get a null-ref exception if I remove the $PATH entry for the sdk, but I upgraded it to .net 5, and I made it a suffix, which should allow it to be overridden. I had to upgrade msbuild to fix the nuget conflicts between the dotnet sdk and msbuild, and then upgrade nuget in omnisharp-roslyn to the same version. |
Oh, wow. It really works! At least all the issues with the sample project are fixed. |
That's great. Thanks for testing. |
Describe the bug
When running
omnisharp
I get an error that project loading failed due to a missing file:The path
/nix/store/pw1ic8h00a9k2c5j1786ivq7zqrc59cb-omnisharp-roslyn-1.37.8/src/.msbuild/Current/Microsoft.Common.props
does not seem to exist on my system.There is only one folder in
/nix/store/pw1ic8h00a9k2c5j1786ivq7zqrc59cb-omnisharp-roslyn-1.37.8/src/.msbuild/Current
, which is calledBin
.Expected behavior
omnisharp
should not throw an error and work as expected.Additional context
omnisharp.json
:Additionally, I've set the environment variables
DOTNET_ROOT
,MSBuildSdksPath
&MSBUILD_EXE_PATH
to the respective paths of my dotnet installation.Notify maintainers
@tesq0 @ericdallo @corngood
Metadata
Maintainer information:
The text was updated successfully, but these errors were encountered: