Obfuscating ASP.Net dll breaks web application

前端 未结 4 2001
北荒
北荒 2021-01-15 08:39

I wouldn\'t usually bother to obfuscate a web application DLL but right now I have to share some server space with someone who might have a conflict of interest and might be

4条回答
  •  灰色年华
    2021-01-15 09:18

    You're close to the solution. In your situation I don't know in which context 'Browse' is used, but are you referencing it somewhere as a string?

    There are some things which simply can't be obfuscated when you're using it in a certain way.

    For example, when you have custom objects which is bound to a control. Those properties which you've specified as a displaymember of valuemember cannot be obfuscated. This is because the properties are defined as a string. So at designtime there's no connection between the control and the actual property, but at runtime there is. I don't know how to explain it better; but here's some code:

    // custom object
    Public Class MyObject
    {
        string Test() { get; set; }
    }
    
    // here the object is bound to a combobox
    
    MyCombo.ValueMember = "Test";  // The Test property cannot be obfuscated because of this 'indirect' reference.
    MyCombo.DisplayMember = "Test";
    MyCombo.DataSource = lstListOfMyObjects;
    

    Hopefully it addresses your problem. If not, let me know.

提交回复
热议问题