Omnisharp-vscode: the extern alias 'XXX' was not specified in a /reference option

Created on 24 May 2018  路  7Comments  路  Source: OmniSharp/omnisharp-vscode

Environment data

dotnet --info output:

.NET Command Line Tools (2.1.201)

Product Information:
 Version:            2.1.201
 Commit SHA-1 hash:  7932dc6179

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17134
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.1.201\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.7
  Build    : 2d61d0b043915bc948ebf98836fefe9ba942be11

VS Code version:
Version 1.23.1
Commit d0182c3417d225529c6d5ad24b7572815d0de9ac
Date 2018-05-10T17:11:17.614Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

C# Extension version: 1.15.2

Steps to reproduce

  • warning: the steps to reproduce I used visual studio to create the project. the problem comes AFTER, when i try to open the project folder within vscode:
  • Create a visual studio project A.
  • Add a reference to project A to any other project, B
  • Go to the properties of that reference, and add an alias. something like 'global,test'
  • add a new class, and put a using statement at the top using the alias, something like
    extern alias test;
    using test::B;

Expected behavior

I expect the project to compile, or not show any compiler warnings. it works in visual studio w/out any issues

Actual behavior

i get 2 errors:

  • the extern alias 'test' was not specified in a /reference option
  • the type or namespace name 'B' does not exist in the namespace 'test'
Bug OmniSharp

Most helpful comment

Thanks! I believe the issue here is that extern alias support needs to be added to the OmniSharp server (https://github.com/OmniSharp/omnisharp-rolsyn). We'll take a look.

All 7 comments

Thanks! I believe the issue here is that extern alias support needs to be added to the OmniSharp server (https://github.com/OmniSharp/omnisharp-rolsyn). We'll take a look.

Is there any update here? I have a project I'm trying to port from VS to VSCode, but it uses extern aliases and reference aliases in the csproj files, but I'm getting the same "problems" in vscode since it doesn't use the alias.

Is this live in the omnisharp VS Code extension yet? I'm still having this issue.1.17.1

@josegomez The C# extension hasn't pulled in that build of omnisharp yet, but you can try it out by setting the value of the option omnisharp.path to latest.

This is live in 1.19.0.

In 1.20.0 this issue still happened.

Was this page helpful?
0 / 5 - 0 ratings