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

PCL assembly shows erroneous errors when using Microsoft.NETCore.Portable.Compatibility #1221

Closed
tetious opened this issue Feb 10, 2017 · 8 comments
Assignees
Milestone

Comments

@tetious
Copy link

tetious commented Feb 10, 2017

This is a followup to issue #424, which I think may be related.

Environment data

dotnet --info output:

Version:            1.0.0-preview2-003148
 Commit SHA-1 hash:  18ca244551

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.11
 OS Platform: Darwin
 RID:         osx.10.11-x64

VS Code version: 1.9.1
C# Extension version: 1.7.0

Steps to reproduce

See sample project here:
https://github.com/tetious/NodaTimePCLTest

This will possibly work with other PCL libraries, but it is super easy to repro with NodaTime.

  1. Create a project with dotnet new.
  2. Add NodaTime and Microsoft.NETCore.Portable.Compatibility

Expected behavior

No errors.

Actual behavior

Use nearly any part of NodaTime and you'll get red squigglies.
mscorlib-error

Build/run works fine.

Let me know if I can give you any more info, and thanks!

@DustinCampbell
Copy link
Member

#424 doesn't look related to me. That was about a very specific sort of project.json project that wraps around a library using "bin".

Could you provide your OmniSharp Log for me after you open the project in VS Code? Just select View->Output from the menu and then choose "OmniSharp Log" from the top-right of the Output pane. Copy all and paste into a reply here. Thanks!

@tetious
Copy link
Author

tetious commented Feb 10, 2017

Here you go!

Starting OmniSharp server at 2/10/2017, 4:46:14 PM
    Target: /Users/greg/RiderProjects/NodaTimePCLTest

OmniSharp server started wth Mono
    Path: /Users/greg/.vscode/extensions/ms-vscode.csharp-1.7.0/bin/run
    PID: 96651

OmniSharp: -s /Users/greg/RiderProjects/NodaTimePCLTest --hostPID 96615 --stdio DotNet:enablePackageRestore=false --encoding utf-8 --loglevel information formattingOptions:useTabs=false formattingOptions:tabSize=4 formattingOptions:indentationSize=4
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Startup","Message":"Omnisharp server running using Stdio at location '/Users/greg/RiderProjects/NodaTimePCLTest' on host 96615."},"Seq":1,"Type":"event"}
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Initializing in /Users/greg/RiderProjects/NodaTimePCLTest
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Auto package restore: False
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Update workspace context
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Update project /Users/greg/RiderProjects/NodaTimePCLTest
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Add project /Users/greg/RiderProjects/NodaTimePCLTest/project.json => 5ee33a92-8997-4cf6-864b-d96be7bcc833
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Resolving projects references
[info]: OmniSharp.DotNet.DotNetProjectSystem
          Processing [ProjectState] NodaTimePCLTest/.NETCoreApp,Version=v1.0
[info]: OmniSharp.DotNet.DotNetProjectSystem
            Added 87 and removed 0 file references
[info]: OmniSharp.DotNet.DotNetProjectSystem
            Added 1 and removed 0 documents.
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        MSBUILD_EXE_PATH environment variable set to /Users/greg/.vscode/extensions/ms-vscode.csharp-1.7.0/bin/omnisharp/msbuild/MSBuild.dll
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        MSBuildExtensionsPath environment variable set to /Users/greg/.vscode/extensions/ms-vscode.csharp-1.7.0/bin/omnisharp/msbuild
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        MSBuildSDKsPath environment variable set to /Users/greg/.vscode/extensions/ms-vscode.csharp-1.7.0/bin/omnisharp/msbuild/Sdks
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        No solution files found in '/Users/greg/RiderProjects/NodaTimePCLTest'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/greg/RiderProjects/NodaTimePCLTest'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Startup
        Configuration finished.

@DustinCampbell
Copy link
Member

Thanks! I can repro and am debugging. It appears to me like the problem is due to mscorlib 4.0.0.0 (from Microsoft.NETCore.Portable.Compatibility) isn't unifying with mscorlib 2.0.5.0, which NodaTime references.

@DustinCampbell
Copy link
Member

Hmmm... If I migrate the project from project.json to .csproj, it appears that it works properly.

@DustinCampbell
Copy link
Member

OK. I've got a fix. As suspect, it was not related to #424.

@DustinCampbell
Copy link
Member

@tetious: I just wanted to let you know that we've released the first beta for 1.8, which contains the fix for this issue: https://github.com/OmniSharp/omnisharp-vscode/releases/tag/v1.8.0-beta1.

You can use these instructions to install a beta release.

@tetious
Copy link
Author

tetious commented Feb 11, 2017

Thanks very much for the super-quick fix! I can confirm that the beta is working properly here.

@DustinCampbell
Copy link
Member

Awesome! Thanks for confirming.

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