Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

the extern alias 'XXX' was not specified in a /reference option #2342

Closed
vishnu4 opened this issue May 24, 2018 · 7 comments
Closed

the extern alias 'XXX' was not specified in a /reference option #2342

vishnu4 opened this issue May 24, 2018 · 7 comments

Comments

@vishnu4
Copy link

vishnu4 commented May 24, 2018

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'
@DustinCampbell
Copy link
Member

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.

@teqdruid
Copy link

teqdruid commented Feb 14, 2019

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.

@filipw
Copy link
Contributor

filipw commented Mar 11, 2019

fixed in OmniSharp/omnisharp-roslyn#1409

@josegomez
Copy link

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

@rchande
Copy link

rchande commented Mar 13, 2019

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

@filipw
Copy link
Contributor

filipw commented Apr 20, 2019

This is live in 1.19.0.

@filipw filipw closed this as completed Apr 20, 2019
@seanmars
Copy link

seanmars commented Jul 9, 2019

In 1.20.0 this issue still happened.

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

No branches or pull requests

7 participants