- Home /
WCF problem in Unity
Hello, we are trying to use IPC 's to connect our game logic with Unity (using unity as nothing but a rendering engine). So far we're only proofing the concept but we've hit an error.
We get this exception from Unity:
InvalidOperationException: Channel type IDuplexSessionChannel is not supported.
public class NewBehaviourScript : MonoBehaviour
{
DataWriter _writer;
void Start ()
{
_writer = new DataWriter(); //EXCEPTION THROWN HERE
}
// Update is called once per frame
void Update ()
{
int[] ent = reader.Reader.GetNewEntities();
}
}
We have a c# library that we've tried compiling both in VS2012 (with .net 3.5 and 4.5) as well as in mono (the same distribrution as Unity uses):
public class DataWriter
{
ChannelFactory<IDataWriter> _pipeFactory;
IDataWriter _pipeProxy;
public DataWriter()
{
_pipeFactory =
new ChannelFactory<IDataWriter>(
new NetNamedPipeBinding(),
new EndpointAddress("net.pipe://localhost/PipeDataWriter"));
_pipeProxy = _pipeFactory.CreateChannel();
}
public IDataWriter Writer
{
get
{
return _pipeProxy;
}
}
}
When running code that does the same thing (creates a new DataWriter) from VS2012, we don't get the exception at all. Is there a workaround to this and/or is there another way to achieve essentially the same thing. What we want is a simple database holding that a game logic client writes to and that we can read from in Unity.
Hi, I am having the exact same problem. Did you find a solution, yet? Thank you!
I have exactly the same problem. I think that I am using the same example. Have you got a solution? What about you boozzz?
did you copy the related mono dll into a plugins directory in your project? If i remember correctly, i have had a similar problem which was resolved that way.
Yes, I have a lot of problems with the right dll( I have to load it from:C:\Program Files (x86)\Unity\Editor\Data\$$anonymous$$onoBleedingEdge\lib\mono\gac\System.Service$$anonymous$$odel\3.0.0.0__b77a5c561934e089). Once its loaded without problems ( if you choose another one wont work), appears the message of incomptibility
Your answer
![](https://koobas.hobune.stream/wayback/20220613143702im_/https://answers.unity.com/themes/thub/images/avi.jpg)