VerificationException when using Unity in Web Player mode

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

Post Reply
Luke.
Posts: 1
Joined: 22 Jan 2015, 13:37

VerificationException when using Unity in Web Player mode

Post by Luke. »

I'm working on a web project that uses Unity3D and SmartFox and I'm having trouble with a specific setting. Whenever my editor is set to "Web Player", I get the following exception:
VerificationException: Error verifying Sfs2X.Logging.LoggerEvent:LogEventType (Sfs2X.Logging.LogLevel): Object not compatible with constrained type at 0x000e
Which is thrown on the 2nd line:

Code: Select all

SmartFox server = new SmartFox (true);
server.AddLogListener(logLevel, (EventListenerDelegate)OnDebugMessage);
And if I omit that line, it is thrown anytime I call a method from the server variable.

If I use the SmartFox constructor without the boolean parameter, and omit the AddLogListener line, I don't get any errors and I can even connect, but I don't receive any of the extension responses (even though I can see through the console that the server is getting my requests and fufilling them without errors.)

Everything works if I build in Standalone mode. It also works on another colleague's computer (Web mode), but I can't find any difference in our project settings.

Reading about the exception didn't help much, except that it is thrown whenever you write unverifiable code and try to compile it to a safe(?) binary. I couldn't find anything else about the other parts of the error.

Client api is v1.5.6

Anyone has any idea about what could be wrong?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: VerificationException when using Unity in Web Player mod

Post by Bax »

Thank you for reporting.
We will investigate and let you know.
Paolo Bax
The SmartFoxServer Team
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: VerificationException when using Unity in Web Player mod

Post by Bax »

We tested the reported (very simple) scenario, but we can't reproduce the issue.
Maybe it has something to do with Unity? A corrupted installation?
Sorry for not being able to help.
Paolo Bax
The SmartFoxServer Team
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: VerificationException when using Unity in Web Player mod

Post by Bax »

Yesterday Unity started throwing the same error after we built the next version of the API dll for testing purposes, for no apparent reason.
Turned out that the issue was caused by the tool we are using, Xamarin, which in turn uses the Mono framework 3.12.
Not sure why this happened yesterday and not two months ago, when we used the same tool already.
Going back to Mono Develop 4.0.1 (delivered with Unity) fixed the issue.
If you are still struggling with this issue contact us by email so we can provide a fixed dll.
Paolo Bax
The SmartFoxServer Team
Post Reply