www.webdeveloper.com
Results 1 to 7 of 7

Thread: Recompiling code into a .dll

  1. #1
    Join Date
    Oct 2006
    Posts
    29

    Recompiling code into a .dll

    Hello, Asp.Net newbie here. I posted an earlier question about missing codebehind files, which I have since had answered.

    I have an Aspnet 1.x website with .aspx and .dll files on the server, but not codebehind files or source code available from the previous developer.

    I have used Lutz Roeder's Reflector program to decompile the .dll, and now I can see all the juicy codebehind for each of the pages of the website.

    My question now is this:

    I want to make some minor changes to validation code. Can I take all the VB code reconstructed by Reflector, pour it into a new Codebehind page with the changes I want to make, and recompile just that page?

    This seems pretty straitforward, but I want to be sure I am not about to screw something up. Will I need to reconstruct all the VB codebehind pages for the whole site for it to recompile, or is one page ok?

    Thanks!

  2. #2
    Join Date
    Oct 2006
    Posts
    36
    Hi...

    Reconstruction of one page is enough.
    But be sure that u recompile the whole thing.
    Njoi Coding
    Chitra Xavier Ray
    .Net Developer

  3. #3
    Join Date
    Nov 2002
    Location
    Auburn, AL
    Posts
    9,224
    Actually, nothing needs to be precompiled, if the application is just republished (as in simply the new files are on the server), it will compile at application runtime. This is if you want to get away from precompiled applications, though there will be a little performance loss, but you will not notice it except on application start since the server will be running a compiled version of your app no matter what.

  4. #4
    Join Date
    Oct 2006
    Posts
    29
    Quote Originally Posted by PeOfEo
    Actually, nothing needs to be precompiled, if the application is just republished (as in simply the new files are on the server), it will compile at application runtime. This is if you want to get away from precompiled applications, though there will be a little performance loss, but you will not notice it except on application start since the server will be running a compiled version of your app no matter what.

    Thanks very much for the replies.

    I don't really care about a slight difference in performance - it is just a simple online store app. If I can get away with resurrecting that one codebehind page, adding the change I want to make, and putting it up - that is, if it can incorporate that one codebehind into the dll without needing all the rest of the missing codebehinds as well - then I should be all set.

    Thanks again!

  5. #5
    Join Date
    Sep 2004
    Location
    Northeast, FL
    Posts
    332
    Nostromo,

    I'm not sure if Chitra Xavier's solution will work or not since both DLL's will reference the same namespace and class. Maybe it will because the DLL compiled with the single code-behind is newer, it'll replace the previous code-behind. Let us know how that works out.

    If his suggestion doesn't work, you could change the name of the code-behind, compile a new DLL and then change the code-behind reference in your aspx page's page direction.

    Otherwise, if you choose to just decompile the whole site's code. Be sure to look at Reflector's add-ins. It has one that will decompile the whole library to files. I've had to do that once already and it was relatively easy. We had a developer who developed on a working copy and absolutely never made iterative back-ups. When she left, her code was in the middle of development and of course there was no snapshot of the production code.

  6. #6
    Join Date
    Oct 2006
    Posts
    29
    Quote Originally Posted by Cstick
    Nostromo,

    I'm not sure if Chitra Xavier's solution will work or not since both DLL's will reference the same namespace and class. Maybe it will because the DLL compiled with the single code-behind is newer, it'll replace the previous code-behind. Let us know how that works out.

    If his suggestion doesn't work, you could change the name of the code-behind, compile a new DLL and then change the code-behind reference in your aspx page's page direction.

    Otherwise, if you choose to just decompile the whole site's code. Be sure to look at Reflector's add-ins. It has one that will decompile the whole library to files. I've had to do that once already and it was relatively easy. We had a developer who developed on a working copy and absolutely never made iterative back-ups. When she left, her code was in the middle of development and of course there was no snapshot of the production code.
    I see what you mean. Since the site is actually running now and taking orders, I want to be able to restore it quickly in case my small change "breaks" the .dll upon recompile.

    If I copy the current .dll onto my HD, I can paste it back in to the FTP site, in case the modified one doesn't work? Or is this not as simple as it seems?

    Thanks

  7. #7
    Join Date
    Sep 2004
    Location
    Northeast, FL
    Posts
    332
    Yes, always backup... Generally, yes, it is just that simple. On rare occasions I've had IIS start acting buggy afterwards and requiring restart, but that is far and few.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles