Can't load the Client API with Unity

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

Moderators: Lapo, Bax

Post Reply
CTucker1327
Posts: 8
Joined: 23 Oct 2013, 01:30

Can't load the Client API with Unity

Post by CTucker1327 »

MonoDevelop IDE:

Code: Select all

Error File name: 'file:///C:\Users\Christian\Documents\Unity\PC\RPG\Assets\Plugins\SmartFox2X.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information. (File name: 'file:///C:\Users\Christian\Documents\Unity\PC\RPG\Assets\Plugins\SmartFox2X.dll' ---> System.NotSupportedException) (Assembly-UnityScript)
I checked out the website, I just can't figure it out.


Unity Error:

Code: Select all

Unhandled Exception: Mono.CSharp.InternalErrorException: Assets/_Scripts/Networking/NetworkingClient.cs(5,14): NetworkingClient ---> Mono.CSharp.InternalErrorException: Assets/_Scripts/Networking/NetworkingClient.cs(7,18): NetworkingClient._c ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

File name: 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

  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.NamespaceEntry.Lookup (System.String name, Location loc, Boolean ignore_cs0104) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.NamespaceEntry.LookupNamespaceOrType (System.String name, Location loc, Boolean ignore_cs0104) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.DeclSpace.LookupNamespaceOrType (System.String name, Location loc, Boolean ignore_cs0104) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.DeclSpace.LookupNamespaceOrType (System.String name, Location loc, Boolean ignore_cs0104) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.MemberCore.LookupNamespaceOrType (System.String name, Location loc, Boolean ignore_cs0104) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.SimpleName.ResolveAsTypeStep (IMemberContext ec, Boolean silent) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.Expression.ResolveAsBaseTerminal (IMemberContext ec, Boolean silent) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.Expression.ResolveAsTypeTerminal (IMemberContext ec, Boolean silent) [0x00000] in <filename unknown>:0 

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

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

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

  at Mono.CSharp.TypeContainer+MemberCoreArrayList.DefineContainerMembers () [0x00000] in <filename unknown>:0 

  --- End of inner exception stack trace ---

  at Mono.CSharp.TypeContainer+MemberCoreArrayList.DefineContainerMembers () [0x00000] in <filename unknown>:0 

  at Mono.CSharp.TypeContainer.DefineContainerMembers (Mono.CSharp.MemberCoreArrayList mcal) [0x00000] in <filename unknown>:0 

  at Mono.CSharp.Class.DefineContainerMembers (Mono.CSharp.MemberCoreArrayList list) [0x00000] in <filename unknown>:0 

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

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

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

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

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

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

  --- End of inner exception stack trace ---

  at Mono.CSharp.RootContext.PopulateTypes () [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 
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Can't load the Client API with Unity

Post by Lapo »

It looks like this problem:
http://stackoverflow.com/questions/1523 ... cas-policy

I am no Windows expert but it seems a Windows security issue.
Let me know if it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Can't load the Client API with Unity

Post by Lapo »

Also here they discuss a similar error report:
http://forum.unity3d.com/threads/118515 ... ine/page30
Lapo
--
gotoAndPlay()
...addicted to flash games
CTucker1327
Posts: 8
Joined: 23 Oct 2013, 01:30

Re: Can't load the Client API with Unity

Post by CTucker1327 »

Just a quick update, using the following method: http://stackoverflow.com/questions/1523 ... cas-policy
I was able to remove two out of three of the errors, however the following error still persists

Code: Select all

c:\Users\Christian\Documents\Unity\PC\RPG\Assets\_Scripts\Networking\NetworkingClient.cs(11,11): Error CS0012: The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. (CS0012) (Assembly-CSharp)
I'll be working on trying to get this one resolved and will post a fix whenever I find one, however I haven't been able to find anything about referencing an assembly. It looks like the problem is I'm using .Net 4.0 somehow, instead of 3.5 (Looking at the Version)
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Can't load the Client API with Unity

Post by Lapo »

Yes, I notice several pointers to the .Net version.
Personally I've never seen this error, neither working with Unity nor posted in this forum. I also don't use Windows very much, so that might partially explain it.
Lapo
--
gotoAndPlay()
...addicted to flash games
CTucker1327
Posts: 8
Joined: 23 Oct 2013, 01:30

Re: Can't load the Client API with Unity

Post by CTucker1327 »

Believe me, if either Unity or Unreal would run inside of Linux without using a Wine Sandbox, I wouldn't even touch windows. I've still been doing my research on changing the .NET Version inside of MonoDevelop, however so far there's been nothing. It's becoming a really, really big headache.

EDIT: After some more research, I finally found a post explaining how to set the .NET Version on MonoDevelop, although this was not my problem as I'm using the correct .NET version(*Sigh*) it may help someone else in the future.

Image
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Can't load the Client API with Unity

Post by Lapo »

Ok. So did the switch from .Net to Mono solve the issue?
Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply