How to avoid .NET 3.5 SP1 Framework dependency?

Posted on 2009-02-08
Last Modified: 2012-05-06
Dear experts,
I'm absolutely lost. Please help me with this deployment issue.

I'm writing a cpp MFC app in Visual Studio 2008. I'm fairly new to cpp and like many others I started off with some tutorials and .sln files that were included with them.

I deploy my app using the deployment project of VS 2008. It seems that my app is using some .NET 3.5 Framework SP1 components because if people don't use the setup.exe (generated by VS) and install the msi directly my app doesn't function properly.

However installing .NET 3.5 SP 1 is a hassle to say the least.So  I would really like to keep my dependencies to NET 2.0. (I understand even Win XP SP1 ships with net 2.0 by default)

Where can I found a comprehensive list of components/header files/functions I should adusjt/not use to roll back the .NET version?

Will it suffice to start a new MFC app. VS 2008 project but select NET 2.0 from the dropdown box available in the top right in project selection dialogue and copy the code?

Whats the best way to tackle this?

thanks in advance!
Question by:EmzThree
    LVL 53

    Accepted Solution

    >> Will it suffice to start a new MFC app. VS 2008 project but select NET 2.0 from the dropdown box available in the top right in project selection dialogue and copy the code?

    Yes, this will make sure that you can't use anything for the .NET framework 3.5
    If you have already used some code for 3.5 (and you copy it, it will give you errors).
    LVL 26

    Assisted Solution

    by:Anurag Thakur
    right click on the project and in the properties select .net 20. as the target framework and none of the 3.0 or 3.5 framework will be used in your application

    Author Comment

    Thanks for quick replies.
    The targeted framework dropdown box is greyed out for me. Any idea why?
    Starting a new project will probably solve it, but it would obviously be easier to just change the targeted network.
    LVL 53

    Expert Comment


    Author Comment

    Thanks for the link. It was an interesting read.

    Couldn't find a way to enable the dropdown box so I just manually edited the .vcproj file

          TargetFrameworkVersion="0" (weird that this was 0 right?)

    Any trouble I should expect by doing this?
    Dropdown still disabled but at least now its showing "NET Framework 2.0"
    LVL 43

    Assisted Solution

    >>>I'm writing a cpp MFC app

    Erm, MFC is NOT dependant on .Net, are you writing a .net app or an MFC app or a mixed app?

    Author Comment

    Update: By going to project properties >config properties>general and enabling "common language runtime support" I was able to change the targeted framework. The code refused to compile though (some types were missing all of a sudden like LPCSTR and LPWSTR) but at least I could "properly change" the targeted version.

    Andy, well I started off with the MFC "dialogue based" new project template. But I added some .NET components while expanding the app.
    LVL 43

    Expert Comment

    Thanks, I'm not going to interfere further.  Bear in mind that mixing managed and unmanaged code is not the simplest of tasks, especially in one project.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    In my previous article ( we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now