You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dotnet --info
.NET Command Line Tools (1.0.3)
Product Information:
Version: 1.0.3
Commit SHA-1 hash: 37224c9917
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/1.0.3
Visual Studio for Mac is able to load the solution without a problem.
Actual behavior
Omnisharp fails to load web project and logs a warning.
[info]: OmniSharp.DotNet.DotNetProjectSystem
Initializing in /Users/breiter/src/wolfereiter/ifes-accounts-payable
[info]: OmniSharp.DotNet.DotNetProjectSystem
Auto package restore: False
[info]: OmniSharp.DotNet.DotNetProjectSystem
Update workspace context
[info]: OmniSharp.DotNet.DotNetProjectSystem
Resolving projects references
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
MSBUILD_EXE_PATH environment variable set to /Users/breiter/.vscode/extensions/ms-vscode.csharp-1.10.0/bin/omnisharp/msbuild/MSBuild.dll
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
MSBuildExtensionsPath environment variable set to /Users/breiter/.vscode/extensions/ms-vscode.csharp-1.10.0/bin/omnisharp/msbuild
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
MSBuild will use local OmniSharp installation.
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Detecting projects in '/Users/breiter/src/wolfereiter/ifes-accounts-payable/IFES-AccountsPayable-no-sqlproj.sln'.
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: /Users/breiter/src/wolfereiter/ifes-accounts-payable/Ifes.AccountsPayable/Ifes.AccountsPayable.csproj
Discovered Mono file path: /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono
Resolved symbolic link for Mono file path: /Library/Frameworks/Mono.framework/Versions/5.0.1/bin/mono-sgen32
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: /Users/breiter/src/wolfereiter/ifes-accounts-payable/Ifes.AccountsPayable.Web/Ifes.AccountsPayable.Web.csproj
[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
Failed to load project file '/Users/breiter/src/wolfereiter/ifes-accounts-payable/Ifes.AccountsPayable.Web/Ifes.AccountsPayable.Web.csproj'.
warn]: OmniSharp.MSBuild.MSBuildProjectSystem
Failed to load project file '/Users/breiter/src/wolfereiter/ifes-accounts-payable/Ifes.AccountsPayable.Web/Ifes.AccountsPayable.Web.csproj'.
/Users/breiter/src/wolfereiter/ifes-accounts-payable/Ifes.AccountsPayable.Web/Ifes.AccountsPayable.Web.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "/Users/breiter/.vscode/extensions/ms-vscode.csharp-1.10.0/bin/xbuild/Microsoft/VisualStudio/v14.0/WebApplications/Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
The key issue is that the environment is resolving $(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets as /Users/breiter/.vscode/extensions/ms-vscode.csharp-1.10.0/bin/xbuild/Microsoft/VisualStudio/v14.0/WebApplications/Microsoft.WebApplication.targets which does not exist because xbuild is not encluded in the ms-vscode.csharp-1.10.0/bin directory.
It does, however, exist on my system as part of the mono distribution bundled with Visual Studio for Mac in /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild.
It doesn't help to set the "omnisharp.useMono": true option and I can't see a way to redefine the environment to look in my mono system install rather than the extension to find the .targets files.
Creating a symlink to embed the xbuild directory from mono into the extension resolves the problem:
Possibly you need to bundle the xbuild directory that mono ships with on macOS and Linux as a dependency for this extension or else have the environment detect that the xbuild directory is in a canonical location and use it.
The text was updated successfully, but these errors were encountered:
Thanks for the report! We still need to do work in omnisharp-roslyn to properly map the tools path in VS for Mac.
Note: setting "omnisharp.useMono" won't do anything for this scenario. That setting is for when you're using a custom OmniSharp build with C# for VS Code.
So far, I've been unsuccessful creating a Web Application project with VS for Mac that doesn't work in VS Code. Is there some specific way I should create a Web Application project?
The projects I have tried were originally created with Visual Studio 2010 and 2013 and have rolled forward to being maintained with Visual Studio 2015 and 2017.
I've got a fix for this in PR here: OmniSharp/omnisharp-roslyn#923. Once it's merged, it'll appear in C# for VS Code once we take a new version of OmniSharp.
Environment data
dotnet --info
output:VS Code version:
C# Extension version: 1.10.0
Steps to reproduce
Load a solution that includes a web project that has an import for
Microsoft.WebApplication.targets
Expected behavior
All projects should load when omnisharp starts.
Visual Studio for Mac is able to load the solution without a problem.
Actual behavior
Omnisharp fails to load web project and logs a warning.
The key issue is that the environment is resolving
$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets
as/Users/breiter/.vscode/extensions/ms-vscode.csharp-1.10.0/bin/xbuild/Microsoft/VisualStudio/v14.0/WebApplications/Microsoft.WebApplication.targets
which does not exist becausexbuild
is not encluded in thems-vscode.csharp-1.10.0/bin
directory.It does, however, exist on my system as part of the mono distribution bundled with Visual Studio for Mac in
/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild
.It doesn't help to set the
"omnisharp.useMono": true
option and I can't see a way to redefine the environment to look in my mono system install rather than the extension to find the .targets files.Creating a symlink to embed the xbuild directory from mono into the extension resolves the problem:
Possibly you need to bundle the xbuild directory that mono ships with on macOS and Linux as a dependency for this extension or else have the environment detect that the xbuild directory is in a canonical location and use it.
The text was updated successfully, but these errors were encountered: