Omnisharp-vscode: wrapped assembly reference issues (The type or namespace 'X' could not be found, are you missing...)

Created on 10 Jun 2016  路  5Comments  路  Source: OmniSharp/omnisharp-vscode

Environment data

.NET Command Line Tools (1.0.0-preview2-002820)

Product Information:
Version: 1.0.0-preview2-002820
Commit SHA-1 hash: d307537eb8

Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
RID: win10-x64

VS Code version: 1.2 / 1.3-insiders
C# Extension version: 1.1.5

Steps to reproduce

I have set up a demo repository here: https://github.com/remcoros/vscode-omnisharp-assemblydemo

Expected behavior

No errors are visible in vscode.

Actual behavior

VSCode shows an error:

The type or namespace name 'ADODB' could not be found (are you missing a using directive or an assembly reference?) [net46]

Notes

'dotnet build' works as expected.

omnisharp output

[INFO] Starting OmniSharp at 'c:\Projects\vscode-assemblydemo'...
[INFO] Started OmniSharp from 'C:\Users\rro.vscode-insiders\extensions\ms-vscode.csharp-1.1.5.omnisharp\OmniSharp.exe' with process id 26384...
OmniSharp: -s c:\Projects\vscode-assemblydemo --hostPID 14564 dnx:enablePackageRestore=false --stdio
[INFORMATION:OmniSharp.Startup] Omnisharp server running using Stdio at location 'c:\Projects\vscode-assemblydemo' on host 14564.
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Initializing in c:\Projects\vscode-assemblydemo
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Auto package restore: True
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Update workspace context
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Update project c:\Projects\vscode-assemblydemo\ADODB
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Add project c:\Projects\vscode-assemblydemo\ADODB\project.json => 43ce4340-cd80-4554-a957-f14c3cc810f0
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Update project c:\Projects\vscode-assemblydemo\Script
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Add project c:\Projects\vscode-assemblydemo\Script\project.json => 5b042b64-aa78-46d1-80a4-5b76bbd04343
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Resolving projects references
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Processing [ProjectState] ADODB/.NETFramework,Version=v3.5
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Added 3 and removed 0 file references
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Processing [ProjectState] Script/.NETFramework,Version=v4.6
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Added 9 and removed 0 file references
[INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Added 1 and removed 0 documents.
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] No solution files found in 'c:\Projects\vscode-assemblydemo'
[INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Detecting CSX files in 'c:\Projects\vscode-assemblydemo'.
[INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Could not find any CSX files
[INFORMATION:OmniSharp.Startup] Configuration finished.

Bug Resolved-Fixed

Most helpful comment

+10 To fix this. Intellisense does not work, Problems window is spammed with huge amount of non-existed errors and becomes unusable. VS code in this scenario works like a simple text editor with colorizing.

All 5 comments

I've been having this issue as well - since 1.0.10. Any updates on this?

Hey, I'm also seeing this issue in VS Code, specifically referencing XUnit. Same behavior, the dotnet CLI builds, runs, and tests are working. I'm using v 1.1.6 of this extension.

Here's my dotnet --info output.

.NET Command Line Tools (1.0.0-preview2-003121)

Product Information:
 Version:            1.0.0-preview2-003121
 Commit SHA-1 hash:  1e9d529bc5

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  14.04
 OS Platform: Linux
 RID:         ubuntu.14.04-x64
.NET Command Line Tools (1.0.0-preview2-003121)

Product Information:
 Version:            1.0.0-preview2-003121
 Commit SHA-1 hash:  1e9d529bc5

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  14.04
 OS Platform: Linux
 RID:         ubuntu.14.04-x64

+10 To fix this. Intellisense does not work, Problems window is spammed with huge amount of non-existed errors and becomes unusable. VS code in this scenario works like a simple text editor with colorizing.

This also breaks when using a PCL assembly via Microsoft.NETCore.Portable.Compatibility with multiple mscorelib reference errors. At least I think that is what is happening.

Sorry for the delay on this! I have a fix specifically for the wrapped assembly case here: https://github.com/OmniSharp/omnisharp-roslyn/pull/749.

@tetious: It's not clear to me that your issue is the same thing. If you have a project that reproduces the problem, please go ahead and file a new issue.

Was this page helpful?
0 / 5 - 0 ratings