Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The C# Project is targeting ".NetFramework, Version=v4.5,Profile=Unity Full v3.5", which is not instaled on this machine

I tried to open a script in VS2015 from Unity 5.6. For some reasons, this popup shows up and I click the first option and change the target to .Net Framework 4.5.2 and everything builds and works as expected. However, every time I made changes in the Unity editor and switched back to Visual Studio, this dialog pops up again.

enter image description here

When I looked into the csproj files, I can see that, after I made changes in the Unity editor, I see this:

<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Unity Full v3.5</TargetFrameworkProfile>

Then after I selected "Change the target to .NET Framework 4.5.2" I see this:

<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>

It seems that the Unity editor is configured to change the .Net Framework to 4.5. I tried to install .Net Framework 4.5 but it is already installed.

Is there any way I can either use .Net 4.5 in Visual Studio or change the target framework in Unity such that this dialog won't pop up again?

like image 675
tuzzer Avatar asked Feb 01 '26 21:02

tuzzer


1 Answers

Before you do anything complicated, try this:

  1. Open Edit>Project Setting>Player
  2. Click Other Setting, go to Configuration, if the scripting runtime version is .NET 3.5, change it to .NET 4.x.

This not only fixed the warning, it also got back VS intellisense and the MathNet.Numerics can now be installed properly.

If this does not work, then try this link project-target-framework-not-installed.

like image 150
JeffreyYe_THU Avatar answered Feb 03 '26 09:02

JeffreyYe_THU