Reflexil and strange reference

2 posts, 0 answers
  1. Simone
    Simone avatar
    8 posts
    Member since:
    Apr 2013

    Posted 27 Feb 2017 Link to this post

    Hello, I'm using JustDecompile with reflexil to "replace" a line in a method. Everything seems to go well, but when I save and reload the patched assembly new "strange" reference are added (that make the assembly not work).

    The two reference have (seems) a dynamic name like these: 0fqzy4ua, 4xzn4wyf.

    This is the method I change:

    public IEnumerator<SqlDataRecord> GetEnumerator()
    {
     if (this.messages != null)
     {
      SqlMetaData[] sqlMetaDatum = new SqlMetaData[] { new SqlMetaData("InstanceId", SqlDbType.UniqueIdentifier), new SqlMetaData("SequenceNumber", SqlDbType.BigInt), new SqlMetaData("Namespace", SqlDbType.NVarChar, (long)255), new SqlMetaData("Name", SqlDbType.NVarChar, (long)255), new SqlMetaData("Value", SqlDbType.NVarChar, (long)255) };
      SqlDataRecord sqlDataRecord = new SqlDataRecord(sqlMetaDatum);
      foreach (TrackingMessage trackingMessage in this.messages)
      {
       foreach (KeyValuePair<XName, string> value in trackingMessage.InstanceStatus.Values)
       {
        sqlDataRecord.SetGuid(0, trackingMessage.InstanceId);
        sqlDataRecord.SetInt64(1, trackingMessage.InstanceStatus.SequenceNumber);
        sqlDataRecord.SetString(2, value.Key.NamespaceName);
        sqlDataRecord.SetString(3, value.Key.LocalName);
        sqlDataRecord.SetString(4, value.Value);
        yield return sqlDataRecord;
       }
      }
     }
    }

     

    with this:

    public IEnumerator<SqlDataRecord> GetEnumerator()
    {
     if (this.messages != null)
     {
      SqlMetaData[] sqlMetaDatum = new SqlMetaData[] { new SqlMetaData("InstanceId", SqlDbType.UniqueIdentifier), new SqlMetaData("SequenceNumber", SqlDbType.BigInt), new SqlMetaData("Namespace", SqlDbType.NVarChar, (long)255), new SqlMetaData("Name", SqlDbType.NVarChar, (long)255), new SqlMetaData("Value", SqlDbType.NVarChar, -1) };
      SqlDataRecord sqlDataRecord = new SqlDataRecord(sqlMetaDatum);
      foreach (TrackingMessage trackingMessage in this.messages)
      {
       foreach (KeyValuePair<XName, string> value in trackingMessage.InstanceStatus.Values)
       {
        sqlDataRecord.SetGuid(0, trackingMessage.InstanceId);
        sqlDataRecord.SetInt64(1, trackingMessage.InstanceStatus.SequenceNumber);
        sqlDataRecord.SetString(2, value.Key.NamespaceName);
        sqlDataRecord.SetString(3, value.Key.LocalName);
        sqlDataRecord.SetString(4, value.Value);
        yield return sqlDataRecord;
       }
      }
     }
    }

    In bold what I change.

    Any help?

    Thank youSimone

  2. Adrian
    Admin
    Adrian avatar
    17 posts

    Posted 07 Mar 2017 Link to this post

    Hi Simone,

    Thanks for letting us know about this problem. I really appreciate this.

    Would it be possible that you zip the assembly where that happens and send it over to me at adrian.bozhankov [at] progress.com? Rather unfortunately, that seems to be the only way to reproduce that problem.

    Regards,
    Adrian
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top