Let*_*nch 7 .net c# deployment publishing
我希望测试页面在一个名为"tests"的文件夹中,并且能够在调试期间运行页面,但是当我发布应用程序时,它会排除这些文件.我正在使用Asp.Net 3.5,Windows Server 2008和c#Vs 2010
您可以将其从项目中排除,这不是很理想,或者您可以使用后期构建事件脚本来删除您不希望发布的文件夹.或者,您可以尝试将类似的内容添加到项目文件中:
<itemgroup>
<excludefrombuild Include="$(SourceWebPhysicalPath)\obj\**\*.*"/>
<excludefrombuild Include="$(SourceWebPhysicalPath)\Properties\**\*.*"/>
<excludefrombuild Include="$(SourceWebPhysicalPath)\**\*.csproj*"/>
<excludefrombuild Include="$(SourceWebPhysicalPath)\**\*.resx"/>
<excludefrombuild Include="$(SourceWebPhysicalPath)\**\*.Publish.xml"/>
</itemgroup>
Run Code Online (Sandbox Code Playgroud)
看看这里有关这方面的更多信息: