-
Notifications
You must be signed in to change notification settings - Fork 168
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
Can't use out-of-box because of MSBuild #834
Comments
What was your fix? What did you need to do to get things working on wsl2? And are you working on a .NET Framework project (Unity, perhaps) or .NET5+? I agree that the documentation needs to be updated, it is time to make |
Sorry I typed too fast and skipped the details.😢 Automatic installationUsing Linux installationHence, I turned into manual installation. But there's no indication regarding to WSL installationLater, I see this
So, I turned into WSL installation.
However, they ask us to download a release version and don't tell us to install the missing Currently, I'm just setting this up. I will setup Unity later, but I haven't done doing it. Did you mean I need to install .NET eventually? |
It seems that things are working, but my another plugin is too slow in directories not in Ubuntu but in Windows. Plus, Unity Editor can't recognize |
This is the relevant part here. The big problem is that Unity still uses "old" .NET. It uses .NET Framework and not .NET Core (now just called dotnet, or .NET5/.NET6/.NET7). In most cases these days, .NET is using the newer dotnet and when you install dotnet you get the msbuild you need along with it. To use OmniSharp-vim with dotnet, you currently have to tell it to use a net6 build, with To run older, .NET Framework projects, you install the .NET Framework on Windows and it also hopefully comes with its own msbuild and as long as you run omnisharp-roslyn in Windows everything works fine. To run .NET Framework projects in other operating systems you need mono. So omnisharp-roslyn used to ship with a cut-down version of mono that it used. However since omnisharp-roslyn has moved on from .NET Framework, and it is normal to use dotnet which has its own tooling included, omnisharp-roslyn no longer ships mono or msbuild. When you try to run omnisharp-vim in wsl, you then need to make some decisions. If you want to use wsl but have the project still be a windows .NET Framework project that you can e.g. also develop in Visual Studio, that's what we created the From what you've said, it sounds like you're mostly interested in running .NET Framework, Unity projects in Windows. If I were you, I would do this from gvim, installed in Windows. WSL1 is also an option and as described in #706, there are possible workarounds to get WSL2 working. As you can see, it's not an entirely simple ecosystem right now. It will be simpler when Unity moves to dotnet. |
Sorry for the late reply and thanks for your explanation! From those information, it seems that I need to install .NET Framework 4.7.1 and MSBuild right? unityIn wiki, there's intruction regarding to generating .csproj files. However, the options aren't the same now. I'm on Unity version 2021.3.12f1. And this is what I did:
Another method I tried is this:
Vim in WSLI installed I save Unity files in Windows and open Vim as a Linux binary with Vim in WindowsIn Windows, both .NET Core and .NET Framework stucks. .NET CoreI installed .NET 7 SDK and set .NET FrameworkSo, I uninstalled .NET 7 and installed .NET 4.7.1 Developer Pack. Hence, MSBuild was installed. This time, althought it found MSBuild without environment variable set, it said it could't find the current version of it in log and no projects were loaded. What else would you suggest I can try? Truly thanks that you would read here. |
@timsu92 Then in .zshrc or .bashrc or whatever shell u use export MSBuildSDKsPath="/usr/lib/dotnet/sdk/7.0.107/Sdks"
export FrameworkPathOverride="/usr/lib/mono/4.5" make sure to assign correct paths Then in project root
|
Summary
In README.md, it's suggested to install with a plugin manager and answering
y
when prompt. However, this is likely to stock (at least) in Ubuntu 22.04 in WSL2 because omnisharp-roslyn has stopped shipping mono and MSBuild. Both methods for installing in Linux and WSL will fail.Environment
Method to work
Since I use WSL2 and readme points out that having a .NET in Windows and modifying
g:OmniSharp_translate_cygwin_wsl
will result in a better performance, let's focus on it!.vimrc
::OmniSharpInstall
MSBuild
by installingBuild Tools for Visual Studio
without any workload. (p.s this is suggested in issue of omnisharp-vscodeAlthought I've solved the problem, I hope these can be done in the install script or by modifying readme.What do you think?
The text was updated successfully, but these errors were encountered: