Hi all, I faced a strange problem when I create a Remoting Services (Http Channel) in .NET 2.0.
I created a remoting services to transfer some objects of a custom class. If the class contains any property, say:
public int TEMP{
get { return this._temp ;}
sety{ this._temp = value;}
}
then client side cannot load the class type (Error message is : Unable to import binding ...blah blah blah..). However, if the custom class doesn’t contain any property, the client side can retrieve the class type successfully. I tried a similar test in VS2003 and it works. Therefore I don’t know why I can’t do the same thing in VS2005.
Thanks for helping.

Cannot transfer objects via remoting http service ( .NET 2.0 )
dave.dolan
Thanks Justice. Here the repro is. This piece of code can work in VS2003, but when it run in VS2005, the client side cannot the create the web reference. The error message from the client side is "The custom tool 'MSDiscoCodeGenerator' failed. Unable to import binding 'TestProgramBinding' from namespace 'http://schemas.microsoft.com/clr/nsassem/RemotingTest%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull".
Best Regards,
WilsonY
[Code]
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels.Http;
using System.Runtime.Remoting.Channels;
namespace RemotingTest {
public class TestProgram : MarshalByRefObject {
static void Main( string[] args ) {
HttpChannel channel = new HttpChannel( 9090 );
ChannelServices.RegisterChannel( channel , false );
// Change to "ChannelServices.RegisterChannel( channel );" in VS 2003
RemotingConfiguration.ApplicationName = "TestingService";
RemotingConfiguration.RegisterWellKnownServiceType( typeof( TestProgram ) , "TestProgram" , WellKnownObjectMode.Singleton );
Console.WriteLine( "Services started." );
char key = 'a';
do {
Console.WriteLine( "Press 'Q' to exit." );
key = (char) Console.Read();
} while ( key != 'Q' );
}
public TestProgram( ) {
}
public void Input( TestObject value ) {
Console.WriteLine( string.Format( "Value ={0}" , value.Number ) );
}
}
[Serializable]
public class TestObject {
private int _number;
public int Number {
get { return this._number; }
set { this._number = value; }
}
public TestObject( ) {
}
}
}
BigMick77
Hi Wilson, properties should work just fine in 2.0. Can you post a simple repro so I can try running over here
Cheers,
JJustice [MSFT]