UnwrapParametersFromDeserializedMethodCallMessage Method returns null
Closed this issue · 1 comments
kod-nik commented
Describe the bug
CoreRemoting\RpcMessaging\MessagingExtensionMethods.cs line 43
The UnwrapParametersFromDeserializedMethodCallMessage() method does not determine the type from parameter.ParameterTypeName and returns null.
It's impossible to work because of this.
CoreRemoting\CoreRemoting\RpcMessaging\MethodCallMessageBuilder.cs line 105
ParameterTypeName = parameterInfo.ParameterType.FullName + "," + parameterInfo.ParameterType.Assembly.GetName().Name,
To Reproduce
Steps to reproduce the behavior:
- Shared interface:
DataTable TestDt(DataTable dt, long num);
- Server:
public DataTable TestDt(DataTable dt, long num)
{
dt.Rows.Clear();
return dt;
}
- Client:
var dt = new DataTable();
dt.Columns.Add("CODE");
dt.Rows.Add(dt.NewRow());
dt.AcceptChanges();
var dt2 = proxy.TestDt(dt, 1);
Expected behavior
The method successfully determines the type.
Additional notes
- Using TargetFramework = net48
- Using NuGet package version 1.2.0.0
- Fixed by getting the name from:
parameterInfo.ParameterType.Assembly.GetName().FullName
yallie commented
I've added a unit test with this code, and the issue is not reproduced.
Looks like it's already fixed:
[Fact]
public void DataTable_roundtrip_works_issue60()
{
using var client = new RemotingClient(...);
client.Connect();
var proxy = client.CreateProxy<ITestService>();
var dt = new DataTable();
dt.TableName = "Issue60";
dt.Columns.Add("CODE");
dt.Rows.Add(dt.NewRow());
dt.AcceptChanges();
var dt2 = proxy.TestDt(dt, 1);
Assert.NotNull(dt2);
}