English 中文(简体)
Get source from pre-compiled ASP.NET website? [closed]
原标题:

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 7 years ago.

Long story short, VSS decided I wasn t allowed to have some code changes. I am missing a decent sized feature that I don t want to have to re-write (gave to a co-op as work this past summer). It works great and does what the client wants. However... I don t have the machine and the machine it was developed on has since been paved low!

Do h!

We published the site into a test environment straight from visual studio and then we copied the files into production. So I have the "compiled" files from the VS publish.

How can I go about getting that back into code? I am sure I can figure out which DLL it is in and I would assume that something like reflector is going to be my best bet? Are the original variable names retained?

最佳回答

I would use .NET reflector. Your original variable names will be preserved (providing you did not run any kind of obfuscator) if you have the PDB files as well as the DLLs.

问题回答

I would suggest trying to reflect your compiled code and see how readable it comes out.

http://www.red-gate.com/products/reflector/

Reflector all the way. You can t rely on local variable names since they don t really exist (only fields retain their names), but having the matching pdb would go a long way to helping. If you use the pro/EAP version of reflector it will do must of the work for you (generating the full C# disassembly etc, so you don t have to go method-by-method or use a plugin).

You may still need to look at each directory separately, of course.

Best you are going to get is with a decompiler like this http://www.red-gate.com/products/reflector/. You are going to lose variable names and comments, but what you get will compile.

Sucks, but probably a lot better then starting from scratch.

I used Telerik s JustDecompile to get the source code back from a precompiled site. It s free and has done everything I ve needed.

http://www.telerik.com/products/decompiler.aspx

Salamander - a .NET decompiler http://www.remotesoft.com/salamander/index.html

I ve never used this tool, but they talked about it on .NET rocks! a while back. http://www.dotnetrocks.com/default.aspx?showNum=194

I had the similar issue and used Reflector to Decompile it. I got the source code, then changed the bit I wanted, and rebuild it. Then I copied that dll again to Production site. It started to reflect my changes. It was very easy and not at all difficult, maybe because Precompiled site had dlls for every page, and was updatable , so had only code-behind file in dll.

For reference: http://www.reflector.net/





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签