Can I change the path for the MSBuild that gets used?
See original GitHub issueEnvironment data
dotnet --info
output:
Runtime Environment:
OS Name: ubuntu
OS Version: 17.04
OS Platform: Linux
RID: ubuntu.17.04-x64
Microsoft .NET Core Shared Framework Host
Version : 2.0.0-preview2-25407-01 Build : 40c565230930ead58a50719c0ec799df77bddee9
VS Code version: 1.16 (insiders) C# Extension version: 1.12.1
Steps to reproduce
Try opening a C# project based on MSBuild and that used the new Sdks feature.
Expected behavior
I expected omnisharp to load the project since I have MSBuild installed with all the relevant SDKs. Building using the msbuild
command works perfectly.
Actual behavior
Omnisharp fails to load the project (that targets net461) since it used its own internal MSBuild without the SDKs installed.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Path to MSBuild - Stack Overflow
To see what gets used if you type msbuild at the command line, do this: where msbuild . If that's not reporting the...
Read more >Customize your build - MSBuild - Microsoft Learn
You can add a new property to every project by defining it in a single file called Directory.Build.props in the root folder that...
Read more >The MSBuild path is not changed when running vcvarsall.bat ...
Also notice the double slash in the path. Running MSBuild from the command line Process Explorer can be used to verify that the...
Read more >Using Standard MSBuild Paths with Visual Studio 2019
For Visual Studio 2019, the first two paths with a \Professional directory differ based on your edition of Visual Studio. As appropriate, you...
Read more >How do I run MSBuild from the command line using Windows ...
Right-clicking on Computer · Click Properties · Then click Advanced system settings on the left navigation bar · On the next dialog box...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, OmniSharp definitely supports that syntax.
Yes, you can have a global
omnisharp.json
file. See this article.Note that the MSBuild in the latest Mono will build .NET Core-style projects for full framework. This is how we build omnisharp-roslyn on OSX and Linux, which targets net46. It’s as easier as running
msbuild OmniSharp.sln
Hey @DustinCampbell, apologies to bring up an old topic here but wanted to ask a similarly related question for probably a very different reason.
I use .NET Core on a Mac and use asdf for version management of many other tools on my machine since most of those tools don’t support having multiple versions installed concurrently. I understand that .NET Core does support multiple versions being installed concurrently on a single machine and that you can further control which is used where with the
global.json
files, but I’d really like to keep asdf as my single tool for other tools’ version management, and asdf does support .NET Core. It works everywhere as I’d expect (dotnet
on CLI resolves fine etc.) except with Omnisharp in VS Code, as theOmniSharp.MSBuild.Discovery.MSBuildLocator
only finds the instance of MSBuild that ships with the OmniSharp extension. I see above you mentioning that I can tell it to look at a particular install of MSBuild via anomnisharp.json
file, but I want it to leverage a dynamic link rather than a single static installation, effectively. I’m curious for advice on this, but also I am a bit curious as to what Omni uses MSBuild for, because everything in my VS Code environment does appear to still work and operate fine. It would appear I can still do most things normally. Context below:In case it’s of any relevance asdf stores particular version installs under
~/.asdf/installs/dotnet-core/<version>/
Omni trace
dotnet --info
Appreciate any help you might be able to offer!