Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Craig Willard 21 posts 126 karma points
    Jan 14, 2015 @ 17:21
    Craig Willard
    0

    Updating code in a compiled DLL

    I'm neither a .NET expert nor an Umbraco expert, so I'm hoping that someone can steer me in the right direction here.

    I have inherited an Umbraco 4.7 project that has a custom search which was written by someone else and (from what I can gather) compiled into a DLL.  This compiled code is causing a problem and I need to somehow update/edit it, either directly or indirectly.  I was able to use a trial version of .NET Reflector to "decompile" the DLL and take a look at the portion of the code that I'm interested in, and the "decompiled" file appears to show the issue - the database connection is opened but never closed.

    So, I need to figure out a way to close the connection, but I do not have access to the source files (I presume those would be C#).  Here are some more details...

    - The "decompiled" file appears to be "calling" a Razor Macro using loadRazorMacro( ) [not sure if that is a custom function or not].

    - I do have access to this macro, but not the variables defined in the DLL, apparently.

    - The search in the DLL is being called via a URL of the form "/base/KDExtensions/..." but I'm not sure how that was configured or how I might update it.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 14, 2015 @ 17:41
    Jan Skovgaard
    0

    Hi Craig

    I'm not too experienced with using reflector myself - But if the source for the project is not available to you I'm thinking that if you buy the full version of reflector, unless you have all the code, then you should be able to rebuild the functionality into a new .dll perhaps, which the search macro can make use of instead?

    /Jan

  • Craig Willard 21 posts 126 karma points
    Jan 14, 2015 @ 19:15
    Craig Willard
    0

    Thanks Jan.

    Is there anything to your knowledge that I can do outside of getting my hands on the original C# files or using Reflector? I will try to go that road but am curious if there are alternatives.

    Also... provided I am able to get access to the source C# files, I'm not familiar with the process of compiling the C# to have it update the "/base/KDExtensions/..." file. Is there a tutorial out there, or another resource you can point me to? I also don't have access to the original dev environment, so am not sure what references or libraries I would need to include.

  • Craig Willard 21 posts 126 karma points
    Jan 22, 2015 @ 04:51
    Craig Willard
    100

    Just an update here, it turns out I can pretty much copy the code from the "Reflected" C# right into my Razor Script.

    As long as I declare that I'm "using" the relevant directives, it works.

    So, problem solved.

Please Sign in or register to post replies

Write your reply to:

Draft