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

VS2019 Not Using Roslyn Compiler From VSIX #34817

Open
SyntaxNode opened this issue Apr 6, 2019 · 1 comment
Open

VS2019 Not Using Roslyn Compiler From VSIX #34817

SyntaxNode opened this issue Apr 6, 2019 · 1 comment
Assignees
Labels
Area-Compilers Area-Infrastructure Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Milestone

Comments

@SyntaxNode
Copy link

Versions Used:

  • Visual Studio 2019 RTM Community for Windows (16.0.0)
  • .Net Core 3.0.100-preview4-010963
  • Local build of master, commit hash: 336c376

Steps to Reproduce:

  • Write a simple program using the Default Interface Implementation feature:
class Program {
    static void Main(string[] args) {
        IFoo x = new Baz();          
        Console.WriteLine(x.Bar());
    }
}

public interface IFoo { int Bar() => 42; }
public class Baz : IFoo { }

Environment
The project is targeting .Net Core 3.0. The 'Use previews of the .Net Core SDK' option is enabled in the experimental instance and main instance. .Net Core 3.0.100-preview4-010963 installed as the highest .Net Core SDK version. Local build of Roslyn's master branch installed in the experimental instance from a RoslynDeployment.vsix build in debug mode. The project explicitly specifies the C# language version '8.0'.

Expected Behavior:

  • No IDE warnings or errors, compiles and runs.

Actual Behavior:

  • No IDE warnings or errors, but the compiler produces the following error:
1>C:\Program Files\dotnet\sdk\3.0.100-preview4-010963\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(151,5): message NETSDK1057: You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview
1>Program.cs(13,29,13,32): error CS0531: 'IFoo.Bar()': interface members cannot have a definition
1>Program.cs(14,20,14,24): error CS0535: 'Baz' does not implement interface member 'IFoo.Bar()'
1>Done building project "ConsoleApp2.csproj" -- FAILED.

The code compiles and runs fine when I use the locally compiled compiler directly. It doesn't look like Visual Studio is invoking the compiler from the VSIX. I have verified the VSIX is installed correctly and the editor is behaving properly with the installed extension.

Does anyone have any tips? Not sure if something changed with the deployables for VS 2019.

Thank you.

@jaredpar
Copy link
Member

Not sure that we ever solved the self host of the compiler in F5 scenarios for .NET. Definitely solved it for desktop. Should be a similar trick that we can do for .NET Core.

This is likely to be a bit low on the priority list though which is why I marked it as "help wanted".

@jaredpar jaredpar added the help wanted The issue is "up for grabs" - add a comment if you are interested in working on it label Aug 28, 2019
@jaredpar jaredpar modified the milestones: 16.4, Compiler.Next Aug 28, 2019
@jaredpar jaredpar modified the milestones: Compiler.Next, Backlog Sep 9, 2019
@gafter gafter added the Bug label Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Area-Infrastructure Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Projects
None yet
Development

No branches or pull requests

4 participants