0

Ive been asked to make some changes to a .Net Web Application. However, the client seems to have "Lost" the precompiled source code.

Traditionally, a .Net Web Application Project must have the codebehind compiled into a DLL, whereas a .Net Website Project can compile itself into runnable code when its requested by the browser.

Since I dont have the original source code to this project, I cant add new code to the DLL. I created a new ascx.cs codebehind file, placed it in the same directory as the ascx page and referenced it from the ascx page.

However, the ascx page can not detect this file. I suspect its because the codebehind is not part of the dll. Is there a way to force the web application to compile the codebehind when its requested by the browser just like a .Net Website project.

I know this is terrible practice and most will say dont do it, so Im also open to alternative suggestions as well. I would like to tell the client I cant work without the source, but its not my decision.

5
  • 1
    try some tool like ILSpy or .Net reflector to get source code back from DLLs. Commented Feb 24, 2015 at 21:07
  • I used, dotPeek, however it was only able to give me about 80% of the code intact, the other 20% had compiler generated artifacts as a result of temp variables and unicode chars it couldnt translate. Commented Feb 24, 2015 at 21:08
  • well those are mostly generic classes, variables, delegates etc. that you have to do yourself. Commented Feb 24, 2015 at 21:39
  • Decompiling is the way to go. 80% is better than having to completely rewrite & reverse engineer the app. See stackoverflow.com/questions/13580243/… for possible voodoo magic solution Commented Feb 24, 2015 at 21:50
  • lmao, reverse engineering is the last thing I wanted to do, Originally I only needed to change 3 lines of code in the dll to make the necessary change. But my supervisor just saw your comments and decided thats gonna be my project for the rest of the week :P Commented Feb 24, 2015 at 21:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.