Posts

Showing posts from January, 2015

Retrieve Source Code from Compiled .NET Program

Image
Background I found myself in this mess. I wrote a lovely windows service to handle data replication between two SQL Servers. I know this isn't the best way to go about it, but the requirement came in late into the project and the database design wasn't going to support automatic replication provided by SQL Server, so I had to develop this windows service. Unfortunately, I lost the source code and backup in a robbery incident and I'm left with just the compiled version deployed with a client. Issue A bug showed up which needed to be fixed, but I didn't have the source anymore. I would have had to go through the stress of re-writing the entire code which took about a month to complete initially if I didn't run into this solution. I'm feeling great right now! Solution It happens that there are a couple of projects targeted at de-compiling .NET codes. I found two: 1 .NET Reflector 2. Just Decompile I tried the .NET reflector and it worked like m

Enabling Write Access to A folder in IIS

Image
Issue Sometimes in web development, we may want to grant WRITE access to a folder probably for file upload purposes or mostly in my own case, PDF file generation purposes. The challenge however, is that all folders are read only which means your application will always throw errors whenever you attempt a write operation. Solution Locate the folder in windows explorer Right click on the folder and select properties In the securities tab, click edit, then click add in the new dialog box that shows up Type IIS AppPool\ApplicationPoolName (you need to replace ApplicationPoolName with the name of the application pool in IIS that your web app is running under) Click Check Names to resolve the name, then click Ok  Under permissions for ..., check Modify under allow.  Click Ok on all dialog boxes Note Some people will grant Modify or Full Control right to Everyone for the folder, note that this posses a huge security risk and should never be your approach to resolving