Vscode-cpptools: C++/CLI Reference assemblies

Created on 22 Jul 2020  路  5Comments  路  Source: microsoft/vscode-cpptools

I am currently unable to include the System::Data namespace to my project.

I have added the switch to my c_cpp_properties.json file:

"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe /clr",

I have also added the path to my referenced assemblies to my include path, as specified in #1987:

"C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.7.2"

However, I still get an error name followed by '::' must be a class or namespace name, if I do:

using namespace System::Data;

The current work around for me is:

// First #using teh dll
#using "System.Data.dll"
// Then using namespace
using namespace System::Data;

Currently, half my team is using VSCode and the other is using Visual Studio. Thus, if this project is opened in Visual Studio (by a team member) the extra #using might seem unnecessary/redundant and be removed.

Is this intended behaviour?

Language Service bug fixed (release pending) quick fix regression

Most helpful comment

@sean-mcmanus thank you for the fast response. Will test this when new update releases.

All 5 comments

Using

            "compilerPath": "cl.exe",
            "compilerArgs": [
                "/ZW",
                "/AI \"C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.7.2\"",
                "/FU \"C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.7.2/System.Data.dll\""
            ]

works with 0.28.1, but there was a regression with 0.28.2 that broke the handling of the /FU flag (and others) -- looks like it's a quick/easy fix.

The fix should be in 0.30.0-insiders (processing of /FU and /FI). If you try 0.28.1 and hit other issues, let us know because those would be different bugs.

@sean-mcmanus thank you for the fast response. Will test this when new update releases.

Reopening for now. We'll close this issue when the fix is released.

This should be fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/0.30.0-insiders . Let us know if you're still hitting issues getting it to work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vicatcu picture vicatcu  路  3Comments

igorPhelype picture igorPhelype  路  3Comments

jheinzel picture jheinzel  路  3Comments

montery8 picture montery8  路  3Comments

ismadelgad11 picture ismadelgad11  路  3Comments