diff --git a/Build/Projects/Protobuild.FunctionalTests.definition b/Build/Projects/Protobuild.FunctionalTests.definition
index 46f32be9..6ad4e19b 100644
--- a/Build/Projects/Protobuild.FunctionalTests.definition
+++ b/Build/Projects/Protobuild.FunctionalTests.definition
@@ -63,6 +63,9 @@
+
+
+
@@ -258,6 +261,16 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/Protobuild.FunctionalTests/ExcludeAttributeMissingOnItemsThatDontUseItTest.cs b/Protobuild.FunctionalTests/ExcludeAttributeMissingOnItemsThatDontUseItTest.cs
new file mode 100644
index 00000000..db653a02
--- /dev/null
+++ b/Protobuild.FunctionalTests/ExcludeAttributeMissingOnItemsThatDontUseItTest.cs
@@ -0,0 +1,29 @@
+namespace Protobuild.Tests
+{
+ using System.IO;
+ using Prototest.Library.Version1;
+
+ public class ExcludeAttributeMissingOnItemsThatDontUseItTest : ProtobuildTest
+ {
+ private readonly IAssert _assert;
+
+ public ExcludeAttributeMissingOnItemsThatDontUseItTest(IAssert assert) : base(assert)
+ {
+ _assert = assert;
+ }
+
+ public void GenerationIsCorrect()
+ {
+ this.SetupTest("ExcludeAttributeMissingOnItemsThatDontUseIt");
+
+ this.Generate("Windows");
+
+ _assert.True(File.Exists(this.GetPath(@"Module.Windows.sln")));
+ _assert.True(File.Exists(this.GetPath(@"Console\Console.Windows.csproj")));
+
+ var projectContents = this.ReadFile(@"Console\Console.Windows.csproj");
+
+ _assert.DoesNotContain("Exclude=", projectContents);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Protobuild.FunctionalTests/ExcludeAttributeOnItemsGeneratedCorrectlyTest.cs b/Protobuild.FunctionalTests/ExcludeAttributeOnItemsGeneratedCorrectlyTest.cs
new file mode 100644
index 00000000..9a4e1270
--- /dev/null
+++ b/Protobuild.FunctionalTests/ExcludeAttributeOnItemsGeneratedCorrectlyTest.cs
@@ -0,0 +1,29 @@
+namespace Protobuild.Tests
+{
+ using System.IO;
+ using Prototest.Library.Version1;
+
+ public class ExcludeAttributeOnItemsGeneratedCorrectlyTest : ProtobuildTest
+ {
+ private readonly IAssert _assert;
+
+ public ExcludeAttributeOnItemsGeneratedCorrectlyTest(IAssert assert) : base(assert)
+ {
+ _assert = assert;
+ }
+
+ public void GenerationIsCorrect()
+ {
+ this.SetupTest("ExcludeAttributeOnItemsGeneratedCorrectly");
+
+ this.Generate("Windows");
+
+ _assert.True(File.Exists(this.GetPath(@"Module.Windows.sln")));
+ _assert.True(File.Exists(this.GetPath(@"Console\Console.Windows.csproj")));
+
+ var projectContents = this.ReadFile(@"Console\Console.Windows.csproj");
+
+ _assert.Contains("", projectContents);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Protobuild.FunctionalTests/ExcludeAttributeOnItemsSynchronisedCorrectlyTest.cs b/Protobuild.FunctionalTests/ExcludeAttributeOnItemsSynchronisedCorrectlyTest.cs
new file mode 100644
index 00000000..87eeec47
--- /dev/null
+++ b/Protobuild.FunctionalTests/ExcludeAttributeOnItemsSynchronisedCorrectlyTest.cs
@@ -0,0 +1,40 @@
+namespace Protobuild.Tests
+{
+ using System.IO;
+ using Prototest.Library.Version1;
+
+ public class ExcludeAttributeOnItemsSynchronisedCorrectlyTest : ProtobuildTest
+ {
+ private readonly IAssert _assert;
+
+ public ExcludeAttributeOnItemsSynchronisedCorrectlyTest(IAssert assert) : base(assert)
+ {
+ _assert = assert;
+ }
+
+ public void GenerationIsCorrect()
+ {
+ this.SetupTest("ExcludeAttributeOnItemsSynchronisedCorrectly");
+
+ // Reset the definition back to it's original version for the test.
+ var original = this.GetPath(@"Build\OriginalProjects\Console.definition");
+ var target = this.GetPath(@"Build\Projects\Console.definition");
+ File.Copy(original, target, true);
+
+ this.OtherMode("sync", "Windows", purge: false);
+
+ var targetContents = this.ReadFile(@"Build\Projects\Console.definition");
+
+ try
+ {
+ _assert.Contains("Exclude=\"Program.cs\"", targetContents);
+ }
+ finally
+ {
+ // Reset the file back after the test passes so that Git doesn't
+ // report this file as changed.
+ File.Copy(original, target, true);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Protobuild.FunctionalTests/TestData/ExcludeAttributeMissingOnItemsThatDontUseIt/Build/Module.xml b/Protobuild.FunctionalTests/TestData/ExcludeAttributeMissingOnItemsThatDontUseIt/Build/Module.xml
new file mode 100644
index 00000000..e796c780
--- /dev/null
+++ b/Protobuild.FunctionalTests/TestData/ExcludeAttributeMissingOnItemsThatDontUseIt/Build/Module.xml
@@ -0,0 +1,6 @@
+
+
+ Module
+ resync
+ true
+
\ No newline at end of file
diff --git a/Protobuild.FunctionalTests/TestData/ExcludeAttributeMissingOnItemsThatDontUseIt/Build/Projects/Console.definition b/Protobuild.FunctionalTests/TestData/ExcludeAttributeMissingOnItemsThatDontUseIt/Build/Projects/Console.definition
new file mode 100644
index 00000000..922b961c
--- /dev/null
+++ b/Protobuild.FunctionalTests/TestData/ExcludeAttributeMissingOnItemsThatDontUseIt/Build/Projects/Console.definition
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/Protobuild.FunctionalTests/TestData/ExcludeAttributeMissingOnItemsThatDontUseIt/Console/Program.cs b/Protobuild.FunctionalTests/TestData/ExcludeAttributeMissingOnItemsThatDontUseIt/Console/Program.cs
new file mode 100644
index 00000000..f616240e
--- /dev/null
+++ b/Protobuild.FunctionalTests/TestData/ExcludeAttributeMissingOnItemsThatDontUseIt/Console/Program.cs
@@ -0,0 +1,12 @@
+using System;
+
+namespace Console
+{
+ public static class Program
+ {
+ public static void Main(string[] args)
+ {
+ // TODO: Implement console app.
+ }
+ }
+}
\ No newline at end of file
diff --git a/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsGeneratedCorrectly/Build/Module.xml b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsGeneratedCorrectly/Build/Module.xml
new file mode 100644
index 00000000..e796c780
--- /dev/null
+++ b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsGeneratedCorrectly/Build/Module.xml
@@ -0,0 +1,6 @@
+
+
+ Module
+ resync
+ true
+
\ No newline at end of file
diff --git a/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsGeneratedCorrectly/Build/Projects/Console.definition b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsGeneratedCorrectly/Build/Projects/Console.definition
new file mode 100644
index 00000000..64e08b08
--- /dev/null
+++ b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsGeneratedCorrectly/Build/Projects/Console.definition
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsGeneratedCorrectly/Console/Program.cs b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsGeneratedCorrectly/Console/Program.cs
new file mode 100644
index 00000000..f616240e
--- /dev/null
+++ b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsGeneratedCorrectly/Console/Program.cs
@@ -0,0 +1,12 @@
+using System;
+
+namespace Console
+{
+ public static class Program
+ {
+ public static void Main(string[] args)
+ {
+ // TODO: Implement console app.
+ }
+ }
+}
\ No newline at end of file
diff --git a/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Build/Module.xml b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Build/Module.xml
new file mode 100644
index 00000000..e796c780
--- /dev/null
+++ b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Build/Module.xml
@@ -0,0 +1,6 @@
+
+
+ Module
+ resync
+ true
+
\ No newline at end of file
diff --git a/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Build/OriginalProjects/Console.definition b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Build/OriginalProjects/Console.definition
new file mode 100644
index 00000000..bb9b0ba1
--- /dev/null
+++ b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Build/OriginalProjects/Console.definition
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Build/Projects/Console.definition b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Build/Projects/Console.definition
new file mode 100644
index 00000000..bb9b0ba1
--- /dev/null
+++ b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Build/Projects/Console.definition
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Console/Console.Windows.csproj b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Console/Console.Windows.csproj
new file mode 100644
index 00000000..fca13343
--- /dev/null
+++ b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Console/Console.Windows.csproj
@@ -0,0 +1,75 @@
+
+
+
+ Debug
+ AnyCPU
+ 10.0.0
+ 2.0
+ {736E6F43-6C6F-2E65-5769-6E646F777343}
+ Exe
+ Console
+ Console
+ true
+
+ v4.5
+
+ 6
+
+
+ true
+ false
+ full
+ true
+ bin\Windows\AnyCPU\Debug
+ obj\Windows\AnyCPU\Debug
+ bin\Windows\AnyCPU\Debug\Console.xml
+ DEBUG;PLATFORM_WINDOWS
+ prompt
+ 4
+ false
+
+
+ true
+ none
+ bin\Windows\AnyCPU\Release
+ obj\Windows\AnyCPU\Release
+ bin\Windows\AnyCPU\Release\Console.xml
+ PLATFORM_WINDOWS
+ prompt
+ 4
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_PostBuildHookTimestamp>@(IntermediateAssembly->'%(FullPath).timestamp')
+ <_PostBuildHookHostPlatform>$(Platform)
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Console/Program.cs b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Console/Program.cs
new file mode 100644
index 00000000..f616240e
--- /dev/null
+++ b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Console/Program.cs
@@ -0,0 +1,12 @@
+using System;
+
+namespace Console
+{
+ public static class Program
+ {
+ public static void Main(string[] args)
+ {
+ // TODO: Implement console app.
+ }
+ }
+}
\ No newline at end of file
diff --git a/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Module.Windows.sln b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Module.Windows.sln
new file mode 100644
index 00000000..c62d7ad0
--- /dev/null
+++ b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Module.Windows.sln
@@ -0,0 +1,22 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.22609.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Console.Windows", "Console\Console.Windows.csproj", "{736E6F43-6C6F-2E65-5769-6E646F777343}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {736E6F43-6C6F-2E65-5769-6E646F777343}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {736E6F43-6C6F-2E65-5769-6E646F777343}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {736E6F43-6C6F-2E65-5769-6E646F777343}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {736E6F43-6C6F-2E65-5769-6E646F777343}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ EndGlobalSection
+EndGlobal
diff --git a/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Module.Windows.speccache b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Module.Windows.speccache
new file mode 100644
index 00000000..883da1b3
Binary files /dev/null and b/Protobuild.FunctionalTests/TestData/ExcludeAttributeOnItemsSynchronisedCorrectly/Module.Windows.speccache differ
diff --git a/Protobuild.Internal/BuildResources/GenerateProject.CPlusPlus.MonoDevelop.xslt.lzma b/Protobuild.Internal/BuildResources/GenerateProject.CPlusPlus.MonoDevelop.xslt.lzma
index 73abe263..01d71af1 100644
Binary files a/Protobuild.Internal/BuildResources/GenerateProject.CPlusPlus.MonoDevelop.xslt.lzma and b/Protobuild.Internal/BuildResources/GenerateProject.CPlusPlus.MonoDevelop.xslt.lzma differ
diff --git a/Protobuild.Internal/BuildResources/GenerateProject.CPlusPlus.VisualStudio.xslt.lzma b/Protobuild.Internal/BuildResources/GenerateProject.CPlusPlus.VisualStudio.xslt.lzma
index 537e93da..79fd4529 100644
Binary files a/Protobuild.Internal/BuildResources/GenerateProject.CPlusPlus.VisualStudio.xslt.lzma and b/Protobuild.Internal/BuildResources/GenerateProject.CPlusPlus.VisualStudio.xslt.lzma differ
diff --git a/Protobuild.Internal/BuildResources/GenerateProject.CSharp.xslt b/Protobuild.Internal/BuildResources/GenerateProject.CSharp.xslt
index ca66acc6..59ff6155 100644
--- a/Protobuild.Internal/BuildResources/GenerateProject.CSharp.xslt
+++ b/Protobuild.Internal/BuildResources/GenerateProject.CSharp.xslt
@@ -967,6 +967,11 @@
+
+
+
+
+
diff --git a/Protobuild.Internal/BuildResources/GenerateProject.CSharp.xslt.lzma b/Protobuild.Internal/BuildResources/GenerateProject.CSharp.xslt.lzma
index 2141d976..c2e9675f 100644
Binary files a/Protobuild.Internal/BuildResources/GenerateProject.CSharp.xslt.lzma and b/Protobuild.Internal/BuildResources/GenerateProject.CSharp.xslt.lzma differ
diff --git a/Protobuild.Internal/BuildResources/GenerationFunctions.cs-msbuild-hack.lzma b/Protobuild.Internal/BuildResources/GenerationFunctions.cs-msbuild-hack.lzma
index 4ba340ad..8687eb2b 100644
Binary files a/Protobuild.Internal/BuildResources/GenerationFunctions.cs-msbuild-hack.lzma and b/Protobuild.Internal/BuildResources/GenerationFunctions.cs-msbuild-hack.lzma differ
diff --git a/Protobuild.exe b/Protobuild.exe
index a3e92bdf..ed4b4188 100755
Binary files a/Protobuild.exe and b/Protobuild.exe differ
diff --git a/Protobuild/Protobuild.Internal.dll.lzma b/Protobuild/Protobuild.Internal.dll.lzma
index b7201ed7..eece8263 100644
Binary files a/Protobuild/Protobuild.Internal.dll.lzma and b/Protobuild/Protobuild.Internal.dll.lzma differ