- Home /
c# .dll and a target .NET framework to use in visual studio build
I am planing on writing a c# plugin for Unity, that is building a plugin.dll file outside of unity environment(in visual studio), and than using it in my unity project.
When researching this topic I found conflicting information, so I decided to ask you guys: In visual studio I now have a project class library. When I click through properties/application/TargetFramework I can see a dropdown with different .NET frameworks. In Unity Editor I have in buildSettings/playerSettings/otherSettings/ApiCompatibilityLevel: .NET 2.0. So which TargetFramevork should I use in Visual studio so my .dll is compatible with my unity project, and why is that. Ofcourse I would like to use something higher than 2.0 but maybe not the latest. to enshure wider (unupdated)machine compatibility (as I understand this).
Thanks for all the info, it is much appreciated.
ps: this plugin.dll will be used in other non unity applications, so I guess Target Frameworks like Unity 3.5 full base class libraries are a no-go?
Answer by fashrista · Mar 14, 2018 at 03:21 PM
Ok I can now answer this.question myself; Through quick trial and error routine Unity cried out that I should be using .Net 3.5 Framework or lower. So I tried 3.5 visual studio dll bild and it works great. Thanks anyway and hope this thread helps anyone with similar issues. If anyone has something to add on this topic please do so, 'couse my answer does not really explain anything.
Your answer
Follow this Question
Related Questions
NuGetForUnity not working with .NET 4.x? 0 Answers
How to change Visual Studio project Target Framework to .net 4.6.X? 0 Answers
Importing a DLL that contains C#-wrapped C++ Code 0 Answers
Unity plugins 0 Answers