Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6349115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:33:07+00:00 2026-05-24T21:33:07+00:00

We have a few apps that still have to be 2.0 because they are

  • 0

We have a few apps that still have to be 2.0 because they are going to go on client machines that won’t have the v3.5 framework installed, and we want to make sure no code gets slipped in that doesn’t belong. I know the 3.5 framework includes the 2.0 framework. That said, we’re trying to make sure that if someone inadvertently changes the targeted version on a specific project from 2.0 to something else, our automated builds will fail. This shouldn’t happen, but we’re trying to be extra careful.

We thought there might be someway using beforeBuild and possibly the TargetFrameworkVersion in the .csproj file. As in “if the TargetFrameworkVersion is not 2.0, output message and fail the build”. Is this possible/the best way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:33:08+00:00Added an answer on May 24, 2026 at 9:33 pm

    It sounds like you want to change the “Target Framework” of the project(s) in question to .Net Framework 2.0.

    From the MSDN article “If you change the .NET Framework version, you may receive error messages if your code contains references to a different version. “

    Great MSDN walk-through here: http://msdn.microsoft.com/en-us/library/bb398202.aspx

    If you want to enforce version 2.0 on the build server, then modify the msbuild options to “override” the toolset version to 2.0. This command switch takes precedent over the project settings file, and “causes all projects and their project-to-project dependencies to be built according to that ToolsVersion, even if each project in the solution specifies its own”. Here is the msdn on what a toolset is: http://msdn.microsoft.com/en-us/library/bb383796(v=vs.90).aspx and here is the MSDN on how to specify the command line switch: http://msdn.microsoft.com/en-us/library/bb383985(v=vs.90).aspx

    If you are using TFS to do your nightly builds then here is how to add the argument (i’m using VS 2010 Pro):

    1. Go to Team Explorer and expand the project
    2. Right click the builds item
    3. Select New Build Definition (or edit an existing build definition)
    4. Go to Process
    5. Expand “Agent Settings”
    6. Find MsBuild Arguments.
    7. Add /tv:2.0 and save the build changes when you have finished with any other settings.

    Now, even if the project file changes the build server will catch code above the 2.0 level and fail. If you are not using TFS to do the builds, see if your tool lets you modify the msbuild command line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a api app that sits behind a few client facing apps. The
I have a few apps in my project that I want to be reusable.
I have seen a few OSX apps that have a Special Characters menu item
I have a few medium-sized Rails apps that I work on routinely, and only
I have written a few apps for the iphone now, but they are all
So I'm writing a framework on which I want to base a few apps
I have been researching a few different apps lately for my company which are
I have few basic questions on session management in GWTP. Client : GWTP, Server
I have an old VB6 app which I'm still trying to support. A few
I have had a few issues with my apps splash screen, how this stated

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.