-
Notifications
You must be signed in to change notification settings - Fork 418
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
Could not load file or assembly 'Microsoft.Build, Version=15.1.0.0' #2174
Comments
A relevant detail I got from the OmniSharp log is that you appear to have Visual Studio 2019 installed, which I would have expected to take care of all msbuild requirements |
Can you share the repro project? |
Yes and I have no issue with building the project with Visual Studio 2019. I must say that the project does have particular setup with some dlls found in some custom directories. Tell me if there's anything I can do to provide more information...
I'm sorry, I can't. Unfortunately, the project is proprietary. |
I see that omnisharp lists places where it finds MSBuild DLLs:
Is it possible to give omnisharp a list of directory where it can look for DLLs ? I have a bunch of places where the file may be so if I could add directories for omnisharp to look for, then it could may be fix my issue? |
@sim590 you'll get a lot more detail about what omnisharp-roslyn is doing, and where it's currently looking for DLLs, if you enable debug logging. Do this by passing the let g:OmniSharp_loglevel = 'debug' As for configuring DLL locations, the various omnisharp-roslyn configuration options are described in this wiki article: Configuration Options. However, as far as I know these options are for locating MSBuild and associated runtime/sdk DLLs, and not for project references. @filipw may be able to confirm whether this is correct. |
I've searched for
I put the results in this file: msbuild-15.1.0.0-references.txt Is there something that comes out of the ordinary? May be I have some settings that omnisharp-roslyn picks up here while I wouldn't want it for compiling my project. I got some info from my coworkers that we don't really use specifically I have upgraded Visual Studio 2019 and I don't have it listing the assembly version 15.1.0.0 anymore:
I'm not sure if it's worth something to bring that up, but in any case. |
I have found that Visual Studio config files have some relative paths for referencing I suspect that this does not play nice with Omnisharp or Omnisharp on WSL2. I currently use @nickspoons' suggestion for making Omnisharp-vim work under WSL2: OmniSharp/omnisharp-vim#706 (comment) @nickspoons: could the working directory be altered at some point for Omnisharp (or one of its subprocess) so that this could happen? |
I am trying to revive this issue. Does omnisharp-roslyn actually support MSBuild custom tasks? I think that the issue seems to be related to this because the loading of EDIT: I have just tried with VSCode and I'm getting the same error while Visual Studio doesn't have issue to build. On VSCode, I get:
|
Here is the log: It has been anonymized and I have removed some contents like when parts (or entirety) of a file was displayed in |
I don't think stdioproxy is being used here, I can't see any references to it, except for in linked issues? But to answer the question: There was an issue at one time where nvim on Windows could not communicate with .NET Framework projects, including O#-roslyn. We found that using a small .NET Core proxy program which intercepted and passed on all messages between neovim and O#-roslyn was a usable workaround. That turned out to be a neovim libuv bug and was eventually fixed in neovim in a much older version. So actually stdioproxy doesn't do anything, simply allows neovim to talk to a .NET Core program instead of .NET Framework - there are obviously differences in the way the 2 frameworks handle stdio but that's above my pay grade. |
@sim590 if I were you, I'd try to make a repro case. You can't share your project as it is so perhaps make a stripped down version that removes all code but keeps the project/solution/build tasks? |
I'll try to do that. |
Also, is this all only happening from WSL still? Can you run omnisharp-roslyn against your project from cmd.exe or windows terminal? |
@nickspoons : No i have tried it on VSCode on Windows (see my first comment this year). Also, it is happening in Neovim running on Windows inside the Windows Terminal (no WSL). Both do the same error. |
I ran from the terminal using the Next, I'll try to reduce the whole thing to a reproducible short example. |
OK, so I think that it turns out that I had to configure The following appeared in my log after I edited my config: and now I don't have the issue anymore. Talking about the config, I read the doc and I saw that there was the user global config and the per-project config. So, user config is located in the user directory, but what about the per-project directory? Let's say I have a repo that contains multiple subfolders that all contains separate MSBuild projects. Does omnisharp look for config file by backtracking up the directories until finds the first I tried putting the If it's not supported, please consider my comment as a feature request: look for the first |
Also, it seems like VS Code cannot find I also tried the following without success:
Not sure what's happening. Official wiki says |
Actually, never mind. The issue is back. It had nothing to do with this. I don't know why I couldn't see the errors anymore. I've been coding with the same instance of NeoVim for a good day and I didn't see the message in the log, but now it's back. Or, I mixed up something and I lost track of it. But, since I my config is effective now in NeoVim, then Omnisharp seems to work for the most part. May be it's not gonna block me in the end. |
As I have described here I'm having errors when trying to run
omnisharp-roslyn
on my project. Here is the log file:omnisharp-roslyn.log
It has been 'anonymized'. I hope it is fine. Also, error messages are in french. I don't know how I can change them, sorry.
The project failing to load is configured for the .NET framework 4.8. When running, the following:
I am getting the following result:
The assembly should be there no? I may have also run:
However, it did not change anything.
I ran the following inside the directory containing the
csproj
of the project I'm trying to open and got:I hope we can help me debug this.
Also
I have tried a few steps mentioned on my omnisharp-vim ticket.
I'm not sure if I'm on the right track or what I'm missing. I would really appreciate help on this.
The text was updated successfully, but these errors were encountered: