Skip to content
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

Cannot open Xamarin.Forms project #1624

Closed
jessejiang0214 opened this issue Jul 5, 2017 · 4 comments
Closed

Cannot open Xamarin.Forms project #1624

jessejiang0214 opened this issue Jul 5, 2017 · 4 comments
Assignees
Milestone

Comments

@jessejiang0214
Copy link

jessejiang0214 commented Jul 5, 2017

Environment data

dotnet --info output:

NET Command Line Tools (1.0.1)

Product Information:
 Version:            1.0.1
 Commit SHA-1 hash:  005db40cd1

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.1

VS Code version: 1.13.1
C# Extension version: 1.11.0

Steps to reproduce

  1. Create a new project with Xamarin Studio on Mac or VS on Mac
  2. Open the folder with VS code

Expected behavior

VS code should show IntelliSense, go to definition find references etc

Actual behavior

Error in OmniSharp log

Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "/Users/jesse/.vscode/extensions/ms-vscode.csharp-1.11.0/bin/xbuild/Microsoft/Portable/v4.5/Microsoft.Portable.CSharp.targets" was not found. Also, tried to find "Microsoft/Portable/v4.5/Microsoft.Portable.CSharp.targets" in the fallback search path(s) for $(MSBuildExtensionsPath32) - "/Library/Frameworks/Mono.framework/External/xbuild/" . These search paths are defined in "/Users/jesse/.vscode/extensions/ms-vscode.csharp-1.11.0/bin/omnisharp/OmniSharp.exe.config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.  /Users/jesse/Documents/Project/testProject/testProject/testProject.csproj
  at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00067] in <bdf083ca20c84af487947992fd9a4a29>:0 
  at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00001] in <bdf083ca20c84af487947992fd9a4a29>:0 
@DustinCampbell
Copy link
Member

Thanks for reporting this issue. It has the same underlying cause as #1597.

@DustinCampbell
Copy link
Member

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.

@jessejiang0214
Copy link
Author

Still exist in VS code for Mac 1.17.1 and ms-vscode.csharp 1.12.1

@DustinCampbell
Copy link
Member

I just tried creating a Xamarin.Forms app with iOS and Android heads. After building, I opened it in VS Code and everything appeared to load fine.

Looking more carefully at your error message, I suspect you're seeing an issue with a PCL project, yes? I suspect this may be related to #1779.

Could you reproduce the issue with a small project and provide it here? Also, it would be useful to see your full OmniSharp Log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants