Import external C# library, for Multiplayer-game

Hi at all,
i’m an c# developer and i want to know if is possibile that Unity3D can contact HTTP SERVER with C#.

Usually i use Weborb.NET on the server, and WebOrbClient.Net on the client.
I have try to add the reference in Mono (weborb for dotnet 3.5) but after added the reference, i receive this error:

If i compile with Mono, all fine.
When i return back into Unity3D I see this error:

using Weborb; // type or namespace Weborb. Are you missing an using directive or an assembly reference?

I have added the Reference, and i have added “using”.
So I’m sure that Unity3D can’t import ANY DLL: it’s right?

How i can access at “asp.net” page on my server if i can’t use Weborb/External DLL?

Daniele

Unity3D can import DLLs - in fact all your ‘scripts’ are simply compiled down to DLLs!

However I don’t have time to take a look and see what the problem is in this specific case :frowning:

So yeah, spend more time finding out the exact problem - with some luck others may give you guidance.

did you ensure your assembly was compiled as .net 2.0 - 3.5 and not by error as .NET 4?

Also are you building for web, if so System.Web namespace is a no go (as with various other platforms like mobiles)

WebOrb.Net is available for 2.0, 3.5, 4.0. I use 2.0 library.
MonoDevelop compile it correctly when i add the Reference: without error :slight_smile:

The problem is when i click “PLAY” in Unity3D :frowning:

Daniele

monodevelop has no meaning, you don’t develop for mono but unity (might sound stupid but below explains it)

Unity uses a custom version of mono 2.6 as the normal mono would not work anywhere but osx and windows hence be useless. more specifically depending on platform and depending on which .net set you have choosen in the player settings only part of it are available, with the by far most restrictive subset being used on webplayers for security reasons among other things

but just to be sure: did you put your assembly into the Assets/Plugins folder just to ensure its present for granted for any code outside of standard assets and plugins folder.

I have do “add reference” in Mono Developer, and compiled: stop.
I need to add the DLL in Assets/Plugins folder in Unity3D?

Daniele

Thats correct. only whats inside the Assets folder even exists in your project at all, you can not have code or resources outside.

what you do in monodevelop is of no relevance when it comes to the projects and solutions as unity does not use those projects and solutions at all. they are there for you to easier code your game IN and FOR unity with MonoDevelop and get working autocomplete. thats where their purpose ends

hope this makes sense and clears up your missassumption.

Now it work: found the namespace.
I’ll study if it work correctly and I’ll post here.

daniele

Actually i have found the problem:
Weborb.dll do not found “weborb.config” in the Output folder.

I have try to create an Winform (c#) basic application and it work fine.

“weborb.config” is in the Plugins folder with “weborb.dll”.

Any help?

if you want it to be copied automatically you need to write a postprocessbuild script that copies it. Unity has no inbuilt support and use for them and thus won’t copy them for ya.

You could see if they end in the right position if you put them into Assets/StreamingAssets, although I doubt it

It’s a little bit difficult scenario.
We need to deploy this game on the web.

I have see that when I click “run” than Unity say me that:

I know that there are some external WebServer (Like ElectroServer) that solve this problem.
But I need to change IIS and use ElectroServer: only for 2-3 call ???

D.