"The target application has been unloaded" - the annoying error

"The target application has been unloaded" is highlighted by Visual Studio, but doesn't actually do anything. Interestingly enough the error wasn't doing anything. It was just highlighted by Visual Studio and prevented the syntax highlighter as well as the code builder from working.

After finding nothing on the internet I gave up and went home. On the next day, the error was gone. It turned out that in order to get rid of that error all you needed to do is restart the computer.