我无法改变目标框架[Visual Studio 2017] [英] I can't change target framework [Visual Studio 2017]

查看:747
本文介绍了我无法改变目标框架[Visual Studio 2017]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨。

我正在使用Unity,但它无法识别.NET v4 +,因此我想在我的项目中更改.NET目标框架,但我没有设法找到它。我在互联网上搜索,他们说我们可以在Project中更改它 - >属性 - >
应用程序,但它没有出现在我的项目中(它是一个类库)。 

I'm working with Unity, but it doesn't recognize .NET v4+, so I wanted to change the .NET target framework on my project, but I didn't managed to find it. I searched on the internet and they said that we could change it in Project -> Properties -> Application, but it does not appears on my project (it's a class library). 

当我构建我的项目并将我的.dll发送给Unity时,它说它无法使用它,因为它是4. *版本而不是3.5或更低版本。

我该怎么办?我甚至尝试创建另一个指定3.5版本的项目,但它仍然是v4构建的。

When I built my project and send my .dll to Unity, it says that it can't work with it because it's a 4.* version and not a 3.5 or less version.
What can I do ? I even tried to create another project specifying 3.5 version, but it's still a v4 built.

推荐答案

嗨FlynnSP,

Hi FlynnSP,

我在我身边测试它,我可以更改类库项目的目标框架。

I test it in my side, I could change the target framework for class library project.

还有另一种方法可以获得它。在Visual Studio的"解决方案资源管理器"中,选择您的项目。在菜单栏上,打开"项目"菜单,然后选择"卸载项目"。这将卸载项目的项目(.vsproj)文件并编辑.vsproj文件。在
项目文件中,找到目标Framework版本的条目。例如,如果您的项目旨在使用.NET Framework 4.5,请找到< TargetFrameworkVersion> v4.5 < / TargetFrameworkVersion>在< Property>元素< Project>中的
元件。你可以在这里改变目标框架。

There is also another way to get it. In Visual Studio, in Solution Explorer, select your project. On the menu bar, open the Project menu and choose Unload project. This unloads the project (.vsproj) file for your project and edit your .vsproj file. In the project file, locate the entry for the target Framework version. For example, if your project is designed to use the .NET Framework 4.5, locate <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> in the <PropertyGroup >element of the <Project> element. You could change target framework here.

当你创建新项目时,你可以在这里改变框架:

When you create new project, you could change framework here:

祝你好运,

Joyce


这篇关于我无法改变目标框架[Visual Studio 2017]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆