So while I was at the MVP Summit, an old client got a hold of me and said there was a weird error on the site when a user was trying to post something. He sent me a screenshot and it said could not login as sa to sql server. I remoted into the server where they had moved the application and looked in the web.config file and did not see any connection string that had sa as the user name. So I was stumped. I began to look at the stack trace and realized which assembly this was coming from. This happened to be the only assembly which did not have the source code on the server. I wrote the app over 6 years ago and the laptop the source was on had recently had a failed hard drive.
Anyway, it was a vb.net 1.1 app from visual studio 2003. Yes I used to do a little VB. :) So I realized that there must have been a connection string hard coded in the assembly where the stack trace was coming from. Oh no! How was i going to fix this without changing the sa password on their new host which was not really an option?
First thing I did was download reflector here. I opened the assembly and did see the hard code connection string. Man what an idiot for doing that. Don’t know why I did that at the time, but not a very smart move. So I was stuck. How do I edit an assembly without having to export all the code from reflector, find visual studio 2003 and run it in a virtual, download the rest of the app and pray that I could get it to work. Well i searched for modifying a .net assembly and found this: Reflexil - http://sebastien.lebreton.free.fr/reflexil/ . It is a plug-in that works inside of reflector that allows the modification of the code in the assembly. So i downloaded it opened the assembly, changed the connection string code and then saved it. The .dll ended up being a third the size, but still worked after deploying it to the server. I was shocked. I just had edited a vb.net 1.1 assembly on a windows 7 laptop using reflector while in a session during the MVP summit. Pretty cool I think. Saved me a whole day of figuring out how to run visual studio 2003 and get that code compiled again.