Exclude files from web site publish in Visual Studio

后端 未结 11 1965
醉话见心
醉话见心 2020-11-27 12:44

Can I exclude a folder or files when I publish a web site in Visual Studio 2005? I have various resources that I want to keep at hand in the Solution Explorer, such as alte

11条回答
  •  甜味超标
    2020-11-27 13:10

    If you can identify the files based on extension, you can configure this using the buildproviders tag in the web.config. Add the extension and map it to the ForceCopyBuildProvider. For example, to configure .xml files to be copied with a publish action, you would do the following:

    ...
        ...
            ...
                
                    
                    
                
    

    To keep a given file from being copied, you'd do the same thing but use System.Web.Compilation.IgnoreFileBuildProvider as the type.

提交回复
热议问题