简体   繁体   English

.Net Remoting 序列化问题

[英].Net Remoting serialization issue

I've an issue with the .Net Remoting:我有 .Net Remoting 的问题:

We have two application, a client and a server.我们有两个应用程序,一个客户端和一个服务器。 The client can connect to the server and retrieve a configuration through .Net Remoting.客户端可以连接到服务器并通过 .Net Remoting 检索配置。

We have a setup which allows to deploy our software to the client.我们有一个设置,允许将我们的软件部署到客户端。 This setup obfuscate all our code, but we have an exclusion list (through namespace and DLL) which is excluding all class that are used to transfer data.这种设置混淆了我们所有的代码,但我们有一个排除列表(通过命名空间和 DLL),它排除了所有用于传输数据的类。

It appeared recently that since several months, we have a class in the configuration which is serialized, which is wrong.最近出现了几个月以来,我们在配置中有一个类被序列化了,这是错误的。 We saw that because we can't connect anymore from a debug client to a release(setup) server.我们看到了,因为我们无法再从调试客户端连接到发布(设置)服务器。

The issue is now: how can we find this class.现在的问题是:我们怎样才能找到这个类。

The exception is the following:例外情况如下:

System.Runtime.Serialization.SerializationException occurred
  HResult=-2146233076
  Message=Cannot get the member '<.ctor>b__5'.
  Source=mscorlib
  StackTrace:
    Server stack trace: 
       at System.Reflection.MemberInfoSerializationHolder.GetRealObject(StreamingContext context)
       at System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder holder)
       at System.Runtime.Serialization.ObjectManager.DoFixups()

We tried to see with the deobfuscator what member it is but it seems that the exception isn't complete enough.我们试图用 deobfuscator 查看它是什么成员,但似乎异常还不够完整。

We have a lot of class, heritage, ... and we currently can't find which class is obfuscated but should not.我们有很多类,遗产,......我们目前无法找到哪个类被混淆但不应该。

Since it's a binary serialization, we cannot see easily what is transfered between client and server.由于它是二进制序列化,我们无法轻易看到客户端和服务器之间传输的内容。

What would be the better way(modifying the less the current code) to find which is the obfuscated class?什么是更好的方法(修改较少的当前代码)来找到哪个是混淆类?

EDIT In addition of the dburner answer, I would like to say that I've removed my delegate and used direct method.编辑除了 dburner 的答案,我想说我已经删除了我的委托并使用了直接方法。 Like this, this name is fixed and should not change depending of the compilation.像这样,这个名称是固定的,不应根据编译而改变。

Take a look at this question Could we save delegates in a file (C#)看看这个问题我们可以将委托保存在文件中吗(C#)

Delegates can be serialized and deserialized in the same application if you are lucky because they are pointers to function and a function can have diferent memory locations.如果幸运的话,委托可以在同一个应用程序中被序列化和反序列化,因为它们是指向函数的指针,并且一个函数可以有不同的内存位置。

Because you are trying to deserialize your class in another application you are getting weird errors.因为您试图在另一个应用程序中反序列化您的类,所以您会遇到奇怪的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM