- Home /
How to solve NotImplementedException during using WCF Duplex net.tcp binding?
Full exception message:
NotImplementedException: The requested feature is not implemented. System.ServiceModel.DuplexClientBase`1[TChannel].CreateChannel () System.ServiceModel.ClientBase`1[TChannel].get_InnerChannel () System.ServiceModel.ClientBase`1[TChannel].Open () Assets.ClientProxies.Test.Start () (at Assets/ClientProxies/Test.cs:23)
Appears after i'm trying to open connection.
Simple WCF service without duplex, works perfectly, please help me to make duplex work, the same code on .NET works fine.
Code listing:
using System;
using System.ServiceModel;
using UnityEngine;
namespace Assets.ClientProxies
{
public class Test : MonoBehaviour, IMyServiceCallback
{
private GameObject _obj;
// Use this for initialization
void Start ()
{
Debug.Log("START");
var client = new MyServiceClient(new InstanceContext(this),
new NetTcpBinding(SecurityMode.None),
new EndpointAddress(string.Format("net.tcp://localhost:9000/MyService/Main")));
client.Open(); //<- Error here
Debug.Log(client.GetNumber());
Debug.Log("FINE");
}
// Update is called once per frame
void Update () {
}
public void Hello()
{
throw new NotImplementedException();
}
public IAsyncResult BeginHello(AsyncCallback callback, object asyncState)
{
throw new NotImplementedException();
}
public void EndHello(IAsyncResult result)
{
throw new NotImplementedException();
}
}
}
Hi, how did you get the async $$anonymous$$ehtods in Unity to run?
I know that it have to be without using Task class, because unity don't allow it.
Answer by frabeth · Nov 23, 2013 at 03:01 PM
Hi,
I was facing the same problem, until I copy another version of System.ServiceModel.dll and System.Runtime.Serialization.dll in my Unity Asset (or plugin) folder. You can find these assemblies here : https://www.dropbox.com/sh/z05gp6zsqhshvpx/S-Wywb7NDh
Have a good day !
This worked for me on a different but related issue. I was trying to build a Unity app using WCF and was getting an error whenever I tried to call any of the methods in my proxy class.
System.NullReferenceException: Object reference not set to an instance of an object.
at System.ServiceModel.ClientBase`1[TChannel].get_Channel
I couldn't for the life of me figure out what was wrong with the code until I randomly came across your comment here. Before I was using the System.ServiceModel.dll that can be found in this Unity installation folder (C:\Program Files\Unity\Hub\Editor\2020.1.8f1\Editor\Data\MonoBleedingEdge\lib\mono\2.0-api) but it was throwing the above error. Then I switched to the one you posted above and it worked perfectly. What is the difference???
Answer by Baumkuchen · Nov 15, 2016 at 10:31 PM
Hello can anybody tell me how I could implement Async methods for a WCF service? Like in the solution from EatingPeopleIsFun:
public IAsyncResult BeginHello(AsyncCallback callback, object asyncState)
{
throw new NotImplementedException();
}
I get many errors in Unity ... and when I import a Mono libery with Task sutff for example Unity says that Tasking isn't allowed (only Coroutines allowed)
Your answer
![](https://koobas.hobune.stream/wayback/20220613120100im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
what protocol to use for open connection in unity3d? 1 Answer
Consume wcf service with netTcpBinding in unity 1 Answer
MySQL Connection From Android Platform 0 Answers
headless mode only pro? 1 Answer
Photon Network Muzzleflash 0 Answers