Targeted .NET Framework version change

2019-08-07 21:48发布

How do I go about changing the version for the targeted version of the .NET Framework from 4.5.1 to 4.5 in Visual Studio 2012?

4条回答
叼着烟拽天下
2楼-- · 2019-08-07 22:32

You can usually select your desired target framework within the application properties. Your setup may be slightly different, my Visual Studio installation is using the C# development settings by default, and the example image below is from a WPF project (on the off chance yours is different).

Either right-click on your project in the Solution Explorer and select Properties->Application, or select Properties from the main toolbar in Visual Studio, and select the Application tab. You should be able to select the target framework.

enter image description here

If you can't select the particular framework you're after, the issue may be slightly different.

查看更多
看我几分像从前
3楼-- · 2019-08-07 22:42

Check the target framework of the project you created. To fix your problem change it to .NET Framework version.

To do this right-click your project and select Properties. On the Compile tab, Click Advance Compile Options... and set the Target Framework dropdown to .NET Framework version.

enter image description here

查看更多
贼婆χ
4楼-- · 2019-08-07 22:47

I fixed it! I right clicked on my project - select Edit Project File - Went and looked for the <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> - then saved and reloaded the project.

查看更多
小情绪 Triste *
5楼-- · 2019-08-07 22:50

You need to install the Microsoft .NET Framework x.x.x Developer Pack then only it will be visible under the Target Framework dropdown

查看更多
登录 后发表回答