We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

How to avoid .NET 3.5 SP1 Framework dependency?

Medium Priority
1,202 Views
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!
Comment
Watch Question

Project manager
CERTIFIED EXPERT
Commented:
>> 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).

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Anurag ThakurTechnical Manager
Commented:
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

Commented:
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.
Dirk HaestProject manager
CERTIFIED EXPERT

Commented:

Author

Commented:
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

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

Any trouble I should expect by doing this?
Dropdown still disabled but at least now its showing "NET Framework 2.0"
AndyAinscowFreelance programmer / Consultant
CERTIFIED EXPERT
Commented:
>>>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

Commented:
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.
AndyAinscowFreelance programmer / Consultant
CERTIFIED EXPERT

Commented:
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.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.