"#using" requires C++/CLI mode

Viewed 6162

My code starts off like this:

#include "stdafx.h"
#include <string>
#using <mscorlib.dll>
#using <System.Data.dll>
#using <System.dll>

using namespace System;
using namespace System::Data::OleDb;

but ends up with the compile error "#using" requires C++/CLI mode

I had this problem initially and managed to solve this through following this post IntelliSense: "#using" requires C++/CLI to be enabled. Updated VS2017 to ver 15.3.0 yesterday and now it is broken again. Project Properties are as follows:

enter image description here

Any assistance would be greatly appreciated. P.

2 Answers

I came across the same issue and figured out that the settings(Common Language Runtime Support) were set only for Release configuration. I suggest you to check for all the configurations in your solutions Release/Debug etc.. and set the CLR support option and it should work as expected.

Related