How do I stop XNA/Visual Studio from rebuilding my content project every time I build?
- by Phil Quinn
My group and I are working on a game in XNA 4.0 with Visual Studio 2010/2012. The main solution has 6 projects: 2 XNA game projects (1 executable/ 1 class library), 1 WPF executable for the level editor, 2 standard class libraries, and a content project. Originally, the editor and engine XNA game projects had a content reference to separate content projects. Recently, I consolidated the content projects into one to simplify asset additions. Since pushing these changes to our git repo, certain members of my group have been experiencing weird build issues. Every time they run the project, they have to re-build all of the assets. This happens regardless of whether any changes were made, even if they just run the project directly after building. I've taken a few steps to figure out why this is happening. Below is the MSBuild output set on Normal verbosity.
The seemingly important part is at 4, with the line
4> Rebuilding all content because build settings have changed
1>------ Build started: Project: Engine.Core, Configuration: Debug x86 ------
1>Build started 11/29/2012 3:24:24 AM.
1>ResolveAssemblyReferences:
1> A TargetFramework profile exclusion list will be generated.
1>EmbedXnaFrameworkRuntimeProfile:
1>Skipping target "EmbedXnaFrameworkRuntimeProfile" because all output files are up-to-date with respect to the input files.
1>GenerateTargetFrameworkMonikerAttribute:
1>Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
1>CoreCompile:
1>Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
1>XnaWriteCacheFile:
1>Skipping target "XnaWriteCacheFile" because all output files are up-to-date with respect to the input files.
1>_CopyOutOfDateSourceItemsToOutputDirectoryAlways:
1> Copying file from "<solution-dir>\src\Engine.Core\DialoguePrototypeTestDB.s3db" to "bin\x86\Debug\DialoguePrototypeTestDB.s3db".
1>_CopyAppConfigFile:
1>Skipping target "_CopyAppConfigFile" because all output files are up-to-date with respect to the input files.
1>CopyFilesToOutputDirectory:
1> Engine.Core -> <solution-dir>\src\Engine.Core\bin\x86\Debug\TimeSink.Engine.Core.dll
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:00.13
2>------ Build started: Project: TimeSink.Entities, Configuration: Debug x86 ------
2>Build started 11/29/2012 3:24:25 AM.
2>ResolveAssemblyReferences:
2> A TargetFramework profile exclusion list will be generated.
2>EmbedXnaFrameworkRuntimeProfile:
2>Skipping target "EmbedXnaFrameworkRuntimeProfile" because all output files are up-to-date with respect to the input files.
2>GenerateTargetFrameworkMonikerAttribute:
2>Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
2>CoreCompile:
2>Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
2>XnaWriteCacheFile:
2>Skipping target "XnaWriteCacheFile" because all output files are up-to-date with respect to the input files.
2>_CopyOutOfDateSourceItemsToOutputDirectoryAlways:
2> Copying file from "<solution-dir>\src\Engine.Core\DialoguePrototypeTestDB.s3db" to "bin\x86\Debug\DialoguePrototypeTestDB.s3db".
2>CopyFilesToOutputDirectory:
2> TimeSink.Entities -> <solution-dir>\src\TimeSink.Entities\bin\x86\Debug\TimeSink.Entities.dll
2>
2>Build succeeded.
2>
2>Time Elapsed 00:00:00.11
3>------ Build started: Project: Editor (Editor\Editor), Configuration: Debug x86 ------
4>------ Build started: Project: Engine.Game, Configuration: Debug x86 ------
3>Build started 11/29/2012 3:24:25 AM.
3>CoreCompile:
3> All content is already up to date
3>ResolveAssemblyReferences:
3> A TargetFramework profile exclusion list will be generated.
3>EmbedXnaFrameworkRuntimeProfile:
3>Skipping target "EmbedXnaFrameworkRuntimeProfile" because all output files are up-to-date with respect to the input files.
3>GenerateTargetFrameworkMonikerAttribute:
3>Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
3>CoreCompile:
3>Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
3>XnaWriteCacheFile:
3>Skipping target "XnaWriteCacheFile" because all output files are up-to-date with respect to the input files.
3>_CopyOutOfDateSourceItemsToOutputDirectoryAlways:
3> Copying file from "<solution-dir>\src\Engine.Core\DialoguePrototypeTestDB.s3db" to "bin\x86\Debug\DialoguePrototypeTestDB.s3db".
3>_CopyOutOfDateNestedContentItemsToOutputDirectory:
3>Skipping target "_CopyOutOfDateNestedContentItemsToOutputDirectory" because all output files are up-to-date with respect to the input files.
3>CopyFilesToOutputDirectory:
3> Editor -> <solution-dir>\src\Editor\Editor\bin\x86\Debug\Editor.dll
3>
3>Build succeeded.
3>
3>Time Elapsed 00:00:00.39
4>Build started 11/29/2012 3:24:25 AM.
4>CoreCompile:
4> Rebuilding all content because build settings have changed
4> Building Textures\circle.png -> <solution-dir>\src\Engine.Game\Engine.Game\bin\x86\Debug\Content\Textures\circle.xnb
4> Importing Textures\circle.png with Microsoft.Xna.Framework.Content.Pipeline.TextureImporter
4> Processing Textures\circle.png with Microsoft.Xna.Framework.Content.Pipeline.Processors.TextureProcessor
4> Compiling <solution-dir>\src\Engine.Game\Engine.Game\bin\x86\Debug\Content\Textures\circle.xnb
4> Building Textures\giroux.png -> <solution-dir>\src\Engine.Game\Engine.Game\bin\x86\Debug\Content\Textures\giroux.xnb
4> Importing Textures\giroux.png with Microsoft.Xna.Framework.Content.Pipeline.TextureImporter
4> Processing Textures\giroux.png with Microsoft.Xna.Framework.Content.Pipeline.Processors.TextureProcessor
4> Compiling <solution-dir>\src\Engine.Game\Engine.Game\bin\x86\Debug\Content\Textures\giroux.xnb
4> Building Textures\Body_Neutral.png -> <solution-dir>\src\Engine.Game\Engine.Game\bin\x86\Debug\Content\Textures\Body_Neutral.xnb
4> Importing Textures\Body_Neutral.png with Microsoft.Xna.Framework.Content.Pipeline.TextureImporter
4> Processing Textures\Body_Neutral.png with Microsoft.Xna.Framework.Content.Pipeline.Processors.TextureProcessor
4> Compiling <solution-dir>\src\Engine.Game\Engine.Game\bin\x86\Debug\Content\Textures\Body_Neutral.xnb
4> Building font.spritefont -> <solution-dir>\src\Engine.Game\Engine.Game\bin\x86\Debug\Content\font.xnb
4> Importing font.spritefont with Microsoft.Xna.Framework.Content.Pipeline.FontDescriptionImporter
4> Processing font.spritefont with Microsoft.Xna.Framework.Content.Pipeline.Processors.FontDescriptionProcessor
4> Compiling <solution-dir>\src\Engine.Game\Engine.Game\bin\x86\Debug\Content\font.xnb
4>ResolveAssemblyReferences:
4> A TargetFramework profile exclusion list will be generated.
4>EmbedXnaFrameworkRuntimeProfile:
4>Skipping target "EmbedXnaFrameworkRuntimeProfile" because all output files are up-to-date with respect to the input files.
4>GenerateTargetFrameworkMonikerAttribute:
4>Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
4>CoreCompile:
4>Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
4>_CopyOutOfDateSourceItemsToOutputDirectoryAlways:
4> Copying file from "<solution-dir>\src\Engine.Core\DialoguePrototypeTestDB.s3db" to "bin\x86\Debug\DialoguePrototypeTestDB.s3db".
4>_CopyOutOfDateNestedContentItemsToOutputDirectory:
4>Skipping target "_CopyOutOfDateNestedContentItemsToOutputDirectory" because all output files are up-to-date with respect to the input files.
4>_CopyAppConfigFile:
4>Skipping target "_CopyAppConfigFile" because all output files are up-to-date with respect to the input files.
4>CopyFilesToOutputDirectory:
4> Engine.Game -> <solution-dir>\src\Engine.Game\Engine.Game\bin\x86\Debug\Engine.Game.exe
4>IncrementalClean:
4> Deleting file "<solution-dir>\src\Engine.Game\Engine.Game\bin\x86\Debug\circle.xnb".
4> Deleting file "<solution-dir>\src\Engine.Game\Engine.Game\bin\x86\Debug\giroux.xnb".
4> Deleting file "<solution-dir>\src\Engine.Game\Engine.Game\bin\x86\Debug\Body_Neutral.xnb".
4> Deleting file "<solution-dir>\src\Engine.Game\Engine.Game\bin\x86\Debug\font.xnb".
4>
4>Build succeeded.
4>
4>Time Elapsed 00:00:01.72
========== Build: 4 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
I can't think of how build settings could change between consecutive executions. Like I said, this only happens for half our group. One member is on a 32-bit Windows 7 Prof bootcamp partition on a Mac. Everyone else, including those who don't have the issue, are running straight 64-bit Windows 7 Prof. Both have tried using VS 2010 and VS 2012.
Any insight would be greatly appreciated. Also, I can post more details upon request if this isn't thorough enough.