How many times during the development stage, your project file breaks after the merge? Everything looks great until you deploy the app to test or production server(sic!). You finish your work, go home to spend a great evening with your girlfriend or friends, but the next day, while checking issues reported by the quality team, you might see something like this:

Powershell_01

Or complaints of this kind: Why everything looks like shit!!??

What the hell!? That supposed to work perfectly fine! You go straight to Visual Studio looking for problematic files and baam! Found it!!

Powershell_02

Your view is there but not added to the project. It is that simple and silly. It can be any file - view, stylesheet, script file, and a bunch of others.

So, we need a simple solution to prevent it from happening again.

The problem is trivial and the solution is so too. All you have to do is check if all files listed in the project’s catalog are included in the project configuration file. You can write a simple console app to check it and warn you about files you might be missing.

But instead, I’ve prepared a PowerShell script. This is my first PowerShell script so be nice, and any improvements are very welcome (please do it directly on gist).

You can find script on github.

How can you use it in your current projects?

Just add the script somewhere to your project and use VS package manager console tool.

ENJOY!