I want to have test pages in a folder called "tests" and be able to run pages during debugging, but when I publish the application, it excludes these files. I am using Asp.NET 3.5, Windows Server 2008 and C # Vs 2010
You can either exclude it from the project, which is actually not ideal, or you can use the post-build script event, which will delete the folder that you do not want to publish. Alternatively, you can try adding something like this to the project file:
<itemgroup> <excludefrombuild Include="$(SourceWebPhysicalPath)\obj\**\*.*"/> <excludefrombuild Include="$(SourceWebPhysicalPath)\Properties\**\*.*"/> <excludefrombuild Include="$(SourceWebPhysicalPath)\**\*.csproj*"/> <excludefrombuild Include="$(SourceWebPhysicalPath)\**\*.resx"/> <excludefrombuild Include="$(SourceWebPhysicalPath)\**\*.Publish.xml"/> </itemgroup>
Take a look here for more information:
http://blogs.msdn.com/b/webdevtools/archive/2010/04/22/web-deployment-excluding-files-and-folders-via-the-web-application-s-project-file.aspx