Skip to content

C++ CLI support for assembly references #1987

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

Closed
fgenolini opened this issue May 12, 2018 · 4 comments
Closed

C++ CLI support for assembly references #1987

fgenolini opened this issue May 12, 2018 · 4 comments

Comments

@fgenolini
Copy link

Could you add support for the Microsoft C++ CLI language?

For example, add support for parsing .Net assembly import statements such as:

	using namespace System::Windows::Forms;

also could you add support for managed type parsing, such as:

	public ref class MyForm : public System::Windows::Forms::Form
	{
	};

or

[STAThread]
void Main(array<String^>^ args)
{
}
@bobbrow
Copy link
Member

bobbrow commented May 12, 2018

We do have some support for C++ CLI if you set "compilerPath": "C:/path/to/cl.exe /clr" in your c_cpp_properties.json

image

I didn't see the System::Windows namespace in there though, so I don't think that we've wired up support for assembly references yet. @sean-mcmanus?

@fgenolini
Copy link
Author

Thanks for this.

For the moment I will temporarily fix this by adding

#using "System.Windows.Forms.dll"

in all translation units that I need VS Code to recognise

Regards,

@sean-mcmanus
Copy link
Contributor

Yeah, I just added support for the basic C++/CLI language features and I didn't try it with System.Windows.Forms.

@bobbrow bobbrow changed the title C++ CLI C++ CLI support for assembly references May 14, 2018
@Colengms Colengms removed their assignment Dec 11, 2019
@Colengms Colengms added this to the Backlog milestone Dec 11, 2019
@Colengms
Copy link
Contributor

Colengms commented May 9, 2020

I don't believe there is a bug here. The location of the assembly needs to be specified as an include path. i.e.

"includePath": [
    "${workspaceFolder}/**",
    "C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.8"
],

Using the above, System::Windows::Forms shows up for me via auto-complete, and does not squiggle if used in using namespace.

@Colengms Colengms added by design and removed bug labels May 9, 2020
@Colengms Colengms closed this as completed May 9, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Oct 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants