Our current software development lifecycle involves developers working on code locally, then publishing to a test server location for Q/A. Using the 'Publish' command in Visual Studio 2005 is a lifesaver. But sometimes you want to only publish part of the project, excluding specific files.
Unlike building a windows application or DLL, there is no verbose build language screen when you go to the properties of a web project. Instead, a mysterious vwd.webinfo file is generated that contains instructions for Visual Studio. You can manually edit this file. Opening it in VS will reveal that it's just an XML file. And reading for a while on the web, I found that you can add an ItemGroup node within the VisualWebDeveloper tag.
1 2 3 4 5 6 7 8 9 10 11 12 | <?xml version="1.0" encoding="UTF-8"?> <VisualWebDeveloper> <!-- Visual Studio global web project settings. --> <ItemGroup> <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.config" /> </ItemGroup> <StartupServices> <Service ID="{967B4E0D-AD0C-4609-AB67-0FA40C0206D8}"/> </StartupServices> </VisualWebDeveloper> |
this command excludes .config files from being updated on a publish. hope this helps!