NoWhereToBeSeen
NoWhereToBeSeen

Reputation: 1444

using .net 4 projects with 4.5 target?

I am new to .NET and c#.

There are so many good examples out there made for .NET 4.0, but when I do NUGET it complains that the target .net version mismatches.

I am developing for Windows 8 and Windows Phone 8, so they use .NET 4.5.

Is there any way to just convert the old projects and force them to use .NET 4.5? Or do I need to wait for the author to update his project?

Upvotes: 3

Views: 188

Answers (3)

Sami Kuhmonen
Sami Kuhmonen

Reputation: 31203

You can develop for Windows 8 with .NET 4.0, that's not a problem. Also you can load .NET 4.0 projects into Visual Studio 2012 and then change the properties of the project to .NET 4.5 if you want to. Also all APIs should be usable by themselves without modification.

So do you have a project that is for .NET 4.5 and you're trying to add .NET 4.0 stuff from NUGET or what?

Naturally WinRT projects are totally different from "normal" .NET projects, so they will need converting.

Upvotes: 5

Reed Copsey
Reed Copsey

Reputation: 564891

If you're developing Windows Store or phone applications, you'll need updated projects, as it's a separate runtime. It's "4.5", but it's not the standard 4.5 runtime. If you're developing desktop applications using .NET 4.5, you should be able to use .NET 4 (and earlier) assemblies without issue.

The best option here, when possible, is to have the dependencies by a Portable Class Library usable by all target platforms, but this would require the other projects to be designed this way.

Upvotes: 1

nikola-miljkovic
nikola-miljkovic

Reputation: 670

Depends on what references you use in your code, if they are untouched by 4.0 to 4.5 conversation then you are in luck, however if that is not case you will need author to update code of project to match 4.5.

Upvotes: 0

Related Questions