Unity 2017.10f3 .Net 4.6 target issue

2020-02-06 16:22发布

I've updated the player settings API to be 4.6 as documented. But my project is still targeting 3.5.

I also tried to manually update the csproj to 4.6 But after unity was opened it overrided it again to 3.5.

Notice that I've update the Visual Studio Tools For Unity to the latest version (3.1.0.0)

Anything I'm missing? Is this a known bug? If so, is there a workaround?

1条回答
对你真心纯属浪费
2楼-- · 2020-02-06 16:56

You have to enable this from the Editor itself. By the way, you can now download the latest version which is no longer in beta mode.

Go to Edit --> Project Settings --> Player --> Other Settings --> Configuration --> Scripting Runtime Version --> .NET 4.6 Equivalent

then

Go to Edit --> Project Settings --> Player --> Other Settings --> Configuration --> Api Compatibility Level --> .NET 4.6

This menu may have changed but this where it used to be and I expect it to be there or under that menu.

EDIT:

You must restart Unity Editor then restart Visual Studio to make these changes to take effect.

".NET 4.6 Equivalent" Menu has changed to "Experimental (.Net 4.6 Equivalent)".

If after restarting both Unity and Visual Studio but the version is still not changing, re-install both Unity and Visual Studio and make sure that you are running the latest version of Visual Studio.

Before re-installing visual studio - make sure you installed the latest update, if not try to update first.

查看更多
登录 后发表回答