0

I use Unity 2019.4.2f1 and Rider 2019.2.3.

I tried to use a library NPOI, but it need framework version 4.6.1. Ok, I had set the version 4.6.1 in the solutions Assembly-CSharp and Assembly-CSharp-Editor.

All right, it works. But next step I had save the project and get errors because... the framework in the solution becomes again 4.7.1.

Ok. I tried do it with Visual Studio 2019 and I got same result.

Ok. I tried to write set framework's version in the files Assembly-CSharp.csproj and Assembly-CSharp-Editor.csproj with v4.6.1. And I got same result.

Something automatically sets the version of the framework and I don't understand where is the shit.

WTF? Does anybody know anything about it?

1 Answers1

0

Unity doesn't rely on csproj for compilation. csproj is only created for IDEs.

Theoretically you workaround by moving Rider package from whatever it is on your computer to Packages folder, it becomes your locally developed package, then you can change TargetFrameworkVersion https://github.com/van800/com.unity.ide.rider/blob/0a42b224e6191934884de084ccd59348742a2bc6/Packages/com.unity.ide.rider/Rider/Editor/ProjectGeneration/ProjectGeneration.cs#L83

Ivan Shakhov
  • 1,299
  • 11
  • 12