Next & Previous

Compiling a decompiled ASP.Net MVC website

We recently took delivery of a codebase with no code... well, it might actually turn out that the original developer comes through but I started this process anyway! Currently the binaries on the FTP server are the only resource available.

Set up the environment

Flatten the main project

At this point, the project folder needs to be flattened so that the csproj is in the same directory as all the website files.

Decompile references

Now I went back to navigating the project tree in JustDecompile to discover any other projects I needed

Create a solution

Try it

You're roughly ready to start building and testing it. Visual Studio should present the correct browser-play button in the debug toolbar. If it doesn't, the website csproj is still set up wrong (see the code snippets above). Maybe restart Visual Studio?

You will probably get errors the first time you start the site, you'll have to triage and fix them with liberal use of DuckDuckGo.

Fix global.asax

This might not happen to you, but my website, when launched, complained that it couldn't locate the MyWebsite.MvcApplication class, which had been written to overload HttpApplication. The problem was due to the project output path being bin/Debug instead of just bin.