Unity 3D unable to load plugin

4,840 views
Skip to first unread message

judy3t

unread,
Feb 1, 2012, 1:29:15 AM2/1/12
to lidgren-network-gen3
Using Unity 3.4,f,2 Pro and building (with VS2010) the latest released
version of lidgren with the #defines commented out as instructed on
the wiki, when I put the dll in the Assets/Plugins folder I get the
following errors:


Internal compiler error. See the console log for more information.
output was:
Unhandled Exception: System.TypeLoadException: Could not load type
'System.Runtime.Versioning.TargetFrameworkAttribute' from assembly
'Lidgren.Network'.

at (wrapper managed-to-native)
System.Reflection.Assembly:InternalGetType
(System.Reflection.Module,string,bool,bool)

at System.Reflection.Assembly.GetType (System.String name, Boolean
throwOnError, Boolean ignoreCase) [0x00000] in <filename unknown>:0

at System.Reflection.Assembly.GetType (System.String name) [0x00000]
in <filename unknown>:0

at Mono.CSharp.RootNamespace.GetTypeInAssembly
(System.Reflection.Assembly assembly, System.String name) [0x00000] in
<filename unknown>:0

at Mono.CSharp.RootNamespace.LookupTypeReflection
(Mono.CSharp.CompilerContext ctx, System.String name, Location loc,
Boolean must_be_unique) [0x00000] in <filename unknown>:0

at Mono.CSharp.GlobalRootNamespace.LookupTypeReflection
(Mono.CSharp.CompilerContext ctx, System.String name, Location loc,
Boolean must_be_unique) [0x00000] in <filename unknown>:0

at Mono.CSharp.Namespace.LookupType (Mono.CSharp.CompilerContext
ctx, System.String name, Location loc) [0x00000] in <filename unknown>:
0

at Mono.CSharp.Namespace.Lookup (Mono.CSharp.CompilerContext ctx,
System.String name, Location loc) [0x00000] in <filename unknown>:0

at Mono.CSharp.TypeManager.CoreLookupType
(Mono.CSharp.CompilerContext ctx, System.String ns_name, System.String
name, Kind type_kind, Boolean required) [0x00000] in <filename
unknown>:0

at Mono.CSharp.TypeManager.InitCoreTypes
(Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0

at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0

at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in
<filename unknown>:0


I know next to nothing about plugins at this point and am evaluating
lindgren as a potential networking library to start with for
prototyping a personal project. If you have any clues on how to get
this to just plug and play, that would be great.

Judy

lidgren

unread,
Feb 1, 2012, 3:10:31 AM2/1/12
to lidgren-network-gen3
Looks like either a 32 vs 64 bit issue or .net framework version
issue. Current project files target .net 4.0 - is your unity project
targetting that?

--michael

judy3t

unread,
Feb 1, 2012, 11:14:16 PM2/1/12
to lidgren-network-gen3
Thanks, it was a bit more complicated but...

1) set the library to build x86 (on 64 bit machines)
2) set the NET framwork to 3.5
3) in Unity, Edit->Project Settings->Player and under More, Per-
Platform Settings change Optimization to .NET 2.0 (instead of the
default Net2.0 subset).

Now it imports and I can test it finally. Thanks for aiming me in the
right direction.

Judy

Seb Fehr

unread,
Sep 20, 2012, 10:54:50 PM9/20/12
to lidgren-ne...@googlegroups.com
Thanks, This got the library working in unity for me! you saved me a bunch of time with that post.

Ahmed Yossre

unread,
May 21, 2014, 9:22:15 AM5/21/14
to lidgren-ne...@googlegroups.com
I joined Specially to thank you  :)

MELVIN MORE

unread,
May 16, 2016, 6:35:20 AM5/16/16
to lidgren-network-gen3
Thanks alot 
Reply all
Reply to author
Forward
0 new messages