lidgren / lidgren-network-gen3

Lidgren Network Library
https://groups.google.com/forum/#!forum/lidgren-network-gen3
MIT License
1.19k stars 331 forks source link

var setMethod = fi.SetMethod; #11

Closed Microdust closed 9 years ago

Microdust commented 9 years ago

There seems to be a problem in Netbuffer.Read.Reflection and Netbuffer.Write.Reflection. at line 99 code: var setMethod = fi.SetMethod;

Error: Error 1 'System.Reflection.PropertyInfo' does not contain a definition for 'SetMethod' and no extension method 'SetMethod' accepting a first argument of type 'System.Reflection.PropertyInfo' could be found (are you missing a using directive or an assembly reference?)

I'm on Windows 8.1 Visual Studio 2013, Unity 5.

aienabled commented 9 years ago

Build with #UNITY_4_5 compilation flag for .NET 3.5 Client Profile. It works nice.

charliegillies commented 9 years ago

I had this exact same issue with XNA, Windows 8.1 on Visual Studio 2013 professional.

I replaced 'fi.SetMethod' to 'fi.GetSetMethod(true)' - I believe 'SetMethod' is just a shorthand for the latter. Works as intended for me. I also replaced 'fi.GetMethod' with 'fi.GetGetMethod(true).

lidgren commented 9 years ago

(now uses GetSetMethod)