Search Unity

Targeting .Net assemblies

Discussion in 'Scripting' started by jdj230, Jan 25, 2018.

  1. jdj230

    jdj230

    Joined:
    Sep 22, 2017
    Posts:
    4
    Just wondering if anyone can help me figure out this issue I'm having with my .net assemblies. I currently have my player settings targeting .net framework v3.5 since OpcRcw is contained in windows\assembly but for some reason it wont load.

    Also, OpcNetApi.com won't load OpcCom.Server, this .dll file shows as an unknown .net target.

    I built a script using these files in Visual Studio with a .net 4.0 and 4.5 without any issues. When I tried to build it as 3.5 in VS my .dll files didn't like that very much. I'm thinking that visual studio is able to target both v4.x and v3.5 GAC while Unity can only target one.

    Any help would be greatly appreciated.


     
  2. DonLoquacious

    DonLoquacious

    Joined:
    Feb 24, 2013
    Posts:
    1,667
    Standard assembly disclaimer:
    Unity doesn't use .NET- important distinction there. It uses Mono. All Unity versions prior to 2017.1 were restricted to essentially 3.5 .NET-compiled assemblies or earlier, and often not even those, because Mono of that version doesn't perfectly line up with .NET of that version. If you want to ensure that an assembly is built in a way that's compatible with Unity, use the specific "Unity 3.5 .NET Subset" (or something like that) target option that should be available when you have Visual Studio Tools for Unity installed as a plugin for VS (this comes standard with VS 2015+ I believe).