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

C++/CLI Reference assemblies #5819

Closed
CordreSmith opened this issue Jul 22, 2020 · 5 comments
Closed

C++/CLI Reference assemblies #5819

CordreSmith opened this issue Jul 22, 2020 · 5 comments
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix regression A bug that didn't exist in a previous release
Milestone

Comments

@CordreSmith
Copy link

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?

@sean-mcmanus sean-mcmanus self-assigned this Jul 22, 2020
@sean-mcmanus
Copy link
Contributor

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.

@sean-mcmanus sean-mcmanus added bug Language Service regression A bug that didn't exist in a previous release labels Jul 22, 2020
@sean-mcmanus sean-mcmanus added this to the 0.30.0 milestone Jul 22, 2020
@sean-mcmanus
Copy link
Contributor

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 sean-mcmanus added quick fix fixed Check the Milestone for the release in which the fix is or will be available. labels Jul 22, 2020
@sean-mcmanus sean-mcmanus removed their assignment Jul 22, 2020
@CordreSmith
Copy link
Author

CordreSmith commented Jul 23, 2020

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

@Colengms
Copy link
Contributor

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

@Colengms Colengms reopened this Jul 23, 2020
@sean-mcmanus
Copy link
Contributor

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.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix regression A bug that didn't exist in a previous release
Projects
None yet
Development

No branches or pull requests

3 participants