-
Notifications
You must be signed in to change notification settings - Fork 678
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 doesn't work for WebApplication projects #1368
Comments
OmniSharp doesn't include all of the necessary tasks and targets needed to process any project. The error that MSBuild returned is telling:
Do you have Microsoft.WebApplication.targets anywhere on your system? |
Yes the file is in
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications
the build works in VS2017, it worked in previous versions of vscode/omnisharp.
|
When was it working? Did it work recently in C# for VS Code but some update (maybe to VS 2017) broke it? |
I tried creating a new ASP .NET Web Application (MVC) in VS 2017 and didn't encounter this error. Do you have project that you'd be willing to share out to help repro this problem? |
Eureka! I can repro if I launch VS Code from a VS 2017 Developer Command Prompt, but not from a normal Windows Command Prompt. Do you see the same behavior? |
OK. Digging in a bit, it seems that the presence of the |
…l Studio 2017 if it's present Fixes dotnet/vscode-csharp#1368 This change ensures that OmniSharp will use the MSBuild tools installed with Visual Studio 2017 if they're present on the machine. This allows OmniSharp to properly handle VS 2017 projects where the targets/tasks aren't include with OmniSharp's local MSBuild, such as WebApplication projects as reported in the bug listed above. If VS 2017 is not on the machine, OmniSharp will continue to use its local MSBuild which has a fallback to the Microsoft Build Tools for targets/tasks that it can't find. I've also taken the opportunity to clean up a lot of the MSBuild environment initialized code and project file processing.
Yup, I can confirm it only happens in a 2017 Developer Command Prompt. Thanks for digging into it. |
This will be fixed when we take a new build of OmniSharp into the VS Code extension. |
We're almost in June, when will that be? |
This already happened and the issue was closed. It was fixed in C# for VS Code 1.9. if you're experiencing a similar problem, could you file a new issue? |
Environment data
dotnet --info
output:VS Code version: 1.12.0 insiders
C# Extension version: 1.8.1
Steps to reproduce
Open a folder with an WebApplication csproj in vscode
Expected behavior
Omnisharp should work
Actual behavior
Omnisharp doesn't load the csproj, the relevant errors in the output:
The relevant line from the .csproj file:
The text was updated successfully, but these errors were encountered: