0

I have a C++ assignment and it specifies that I may not use .NET technology in my project. What is .NET and how do I know if my Visual C++ project uses .NET or not?

I am using Visual Studio 2008.

2
  • Please see the "Related" links off to the right side of this page. Commented Aug 27, 2011 at 7:03
  • i did, but i couldn't find one that quite answers my question Commented Aug 27, 2011 at 7:08

4 Answers 4

4

.NET is a Microsoft development framework. Its Common Language Runtime (CLR) is the basis for languages like C#, and it includes a lot of prewritten code libraries for simplifying common tasks.

Long story short, if you're coding in C++, you aren't going to be using any .NET functionality unless you accidentally set up a managed/CLR project, or you're specifically trying to use it.

Therefore, as others said, make sure you create the right kind of project. For a school assignment, you will probably want to create something like a Win32 Console Application. Just make sure that you don't create a CLR project (managed project).

To doublecheck, do this: When your project is open, right click on your project name on the left (in Solution Explorer) and go to properties. Under Configuration Properties->General, you will see the "Common Language Runtime Support" feature at the bottom. Make sure it says "No Common Language Runtime Support," which will ensure the /clr compiler flag is not set.

I just checked that in Visual Studio 2010, so it might be very slightly different in 2008 (they rearranged some of the project menus around a bit), but I'm sure you get the idea.

Sign up to request clarification or add additional context in comments.

Comments

2

If you want to use C++ without .NET you need to make a "UNMANAGED" C++ project.

Comments

2

If your project is using .NET, the auto-generated main function looks like this:

int main(array<System::String ^> ^args) 

If your project doesn't use .NET, the auto-generated the main function usually looks like this:

int _tmain(int argc, _TCHAR* argv[]) 

For more information about .NET, you can just check the Wikipedia article .NET Framework.

Comments

-2

If you are using vanilla Visual Studio 2008, you are using .NET - it's as easy as this. You can still make the project "UNMANAGED" to get a "pure" C++ project.

The .NET Framework is a software framework that runs primarily on Microsoft Windows and is pushed my Microsoft. It allows language interoperability (each language can use code written in other languages), but your prof is most likely not too thrilled that you might just use the rather extensive libraries.

3 Comments

You are wrong: you can build project without .NET framework with Visual Studio 2008
I was in the process of updating my too simplistic answer.
This isn't true. An unmanaged C++ project does not use the .Net framework. Read here: developer.com/net/cplus/article.php/2197621/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.