Skip to content

Instantly share code, notes, and snippets.

@spraints
Created April 28, 2009 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spraints/103443 to your computer and use it in GitHub Desktop.
Save spraints/103443 to your computer and use it in GitHub Desktop.
Finds .cs files that aren't included in a .csproj file.
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Verify" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="SomeProject.csproj" />
<ItemGroup>
<ShouldBeIncluded Include="**/*.cs" Exclude="@(Compile)" />
</ItemGroup>
<Target Name="Verify">
<Error Text="The following cs files are on disk, but not in the csproj: @(ShouldBeIncluded)" Condition="'@(ShouldBeIncluded)' != ''" />
</Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment