1

I need to retarget a project to .Net framework 4 from 4.5.1 (for compatibility with third party software).

It's a collaborative venture, so they they actually need to directly 'lift' some of our projects. The problem also (can) appear(s) on branching our code or when a new developer does a pull from SVN..

If I naively just change target framework in our projects, naturally it messes up the NuGet refs. If I go onto NuGet, of course it only shows newer versions of the packages - which do not /will not work.

I understand that I can do package de-installation/installation manually (e.g. as here How to install an older version of package via NuGet? )

  1. How do I find out exactly which package versions I need for compatibility with .Net Framework 4.0....?
  2. How do I ensure that NuGet does not try to update them in future?
  3. How do I ensure that it all still works on a branch or new developer machine?

It's packages like all the ASP/MVC/Razor stuff, ASP.Net.Web (various) JSON, Ninject ...

Community
  • 1
  • 1
kpollock
  • 3,899
  • 9
  • 42
  • 61

1 Answers1

0

I ended up finding previous versions of the package.config and working it out from there.

However it seem that we use attribute routing - which will need 4.5.1 (I think?)

[HttpGet, Route("Titles")]
public IEnumerable<HtmlOption> GetTitles()

Sigh. But the script was as follows, just for reference

Uninstall-Package WebActivator  -Force
Install-Package WebActivator -Version 1.5.3

Install-Package WebActivatorEx -version 2.0.5

Uninstall-Package Ninject  -Force
Install-Package Ninject -Version 3.2.2.0

Uninstall-Package Ninject.MVC3 -Force
Install-Package Ninject.MVC3 -Version 3.0.0.6

Uninstall-Package Ninject.Web.Common -Force
Install-Package Ninject.Web.Common -Version 3.0.0.7

Uninstall-Package Newtonsoft.Json -Force
Install-Package Newtonsoft.Json -Version 6.0.1

Uninstall-Package Microsoft.AspNet.Mvc -Force
Install-Package Microsoft.AspNet.Mvc -Version 4.0.20710.0

Uninstall-Package Microsoft.AspNet.Razor -Force
install-package Microsoft.AspNet.Razor  -Version 2.0.20710.0

Uninstall-Package Microsoft.AspNet.WebApi -Force
Install-Package Microsoft.AspNet.WebApi -Version 4.0.20710.0

Uninstall-Package Microsoft.AspNet.WebApi.Client -Force
install-package Microsoft.AspNet.WebApi.Client -Version 4.0.20710.0

Uninstall-Package Microsoft.AspNet.WebApi.Core -Force
Install-Package Microsoft.AspNet.WebApi.Core -Version 4.0.20710.0

Uninstall-Package Microsoft.AspNet.WebApi.WebHost -Force
Install-Package Microsoft.AspNet.WebApi.WebHost -Version 4.0.20710.0

Uninstall-Package Microsoft.AspNet.WebPages -Force
Install-Package Microsoft.AspNet.WebPages -Version 2.0.20710.0
kpollock
  • 3,899
  • 9
  • 42
  • 61