See also http://msdn2.microsoft.com
Main Topics
Browse All TopicsI haven't written a Windows app that needed to be compiled in a few years. I just write a quick, simple program (64k compiled .exe) in Visual C++ 2005 to replace a batch file that needed a little more functionality. We keep this tool on our web site for customers to download to automate some steps.
In the past 3 days since this new version, 5 people have tried it, and it has failed for all 5 because none of them are running .NET 2.0. I figured that we might run into a person every once in a while that didn't have .NET 2.0, but I seem to have over-estimated the general population of Windows users. Actually, only 4 of the 5 got the message they needed .NET 2.0, and the 5th person got a runtime error that when researched told me that they don't have any version of .NET framework installed on their computer. This program seems to be totally worthless with the .NET requirement. I don't want to walk the users through downloading and installing a 22 MB .NET runtime so that our simple 64k program will run.
So, my question is: How can I work around this .NET 2.0 requirement? Is there a way to compile the program so that it doesn't need the .NET framework? I have heard there is a switch I can set in the project so it will compile in native code instead of MSIL code. I have played around with the /clr (common Language Runtime support) switch in the project properties under Configuration Properties -> General. This is the closest thing I can find. When I set it to "no common language runtime support" the build fails with a bunch of errors. The project builds fine and runs fine with the /clr switch (as long as .NET is installed). Is there something else I need to do? Can this be done at all? Maybe even in another language?
Any ideas or suggestions to allow me to compile so that users don't have to have .NET installed are appreciated.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
See also http://msdn2.microsoft.com
Business Accounts
Answer for Membership
by: jkrPosted on 2007-09-14 at 09:06:36ID: 19892773
>>Is there a way to compile the program so that it doesn't need the .NET
>>framework?
Absolutely. VC++ 2005 still supports "Native" projects, that is without any managed code. All you need to do is to select an unmanaged project type (in your case probably a "Win32 Console Project") and .NET will not kick in at all.