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 8403983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:28:43+00:00 2026-06-09T22:28:43+00:00

I have migrated a solution that is currently targeting .NET 4.0 in VS2010 to

  • 0

I have migrated a solution that is currently targeting .NET 4.0 in VS2010 to VS2012 and now I would like to re-target it to .Net 4.5

What I am not sure about is the NuGet packages. For example EF5, which I updated from EF4 in VS2010 turns out to be actually EF 4.4 as you can see here:

    <Reference Include="EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\packages\EntityFramework.5.0.0\lib\net40\EntityFramework.dll</HintPath>
    </Reference>

I can also see the following in packages.config for the project:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="EntityFramework" version="5.0.0" targetFramework="net40" />
</packages>

So my question is:

What is the best practice to re-target all NuGet packages that are currently set to target .NET 4.0 to target .NET 4.5?

  • 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-06-09T22:28:45+00:00Added an answer on June 9, 2026 at 10:28 pm

    NuGet 2.1 offers a feature that makes this a lot simpler: just do update-package -reinstall -ignoreDependencies from the Package Manager Console.

    NuGet 2.0 doesn’t handle re-targeting your applications very well. In order to change your packages’ target frameworks, you must uninstall and reinstall the packages (taking note of the packages you had installed so that you can reinstall each of them).

    The reason packages must be uninstalled and reinstalled is:

    • When installing a package, we determine the target framework of your project
    • We then match that up with the package contents, finding the appropriate \lib\ folder (and \content\ folder)
    • Assembly references are added with Hint Paths that point to the package’s \lib\ folder, with the right subfolder (\lib\net40 for example)
    • Content files are copied from the packages \content\ folder, with the right subfolder (\content\net40 for example)
    • We record the targetFramework used to install the package within the packages.config file
    • After you change your project’s target framework, the Hint Paths still point to net40
    • When you uninstall packages, we check the targetFramework that was recorded in packages.config to see what target framework’s libs/content to remove from your project
    • When you reinstall the package, we detect your updated target framework and reference/copy the right libs/content
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We currently have a solution that was completely written by hand in ASP.NET and
I have a solution containing several projects that have migrated from VS 2003, 2005,
Does anyone have experience with companies that have migrated from classic Asp to .Net
I am currently working on a prototype ASP.NET MVC 3 solution that will be
I have a simple MSBuild Script that looks like this. ... <Target Name=CompileSolution> <Exec
I have migrated one ASP.NET v4.0 application to a new server running under a
I have just migrated around 100 ASP.net sites from IIS 6 on Windows Sever
We have been using Perl's Net:Twitter CPAN module (version 3.12) and basic authentication (not
I have an ASP.NET application that makes extensive use of ASP.NET cache API for
I have been struggling with the best way to make sure that the certain

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.