Exclude files from web site publish in Visual Studio

后端 未结 11 1959
醉话见心
醉话见心 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:11

    For Visual Studio 2017, WebApp Publish, first create a standard file system publish profile. Go to the App_Data\PublishProfiles\ folder and edit the [profilename].pubxml file.

    Add

    [file1.ext];[file2.ext];[file(n).ext]
    

    under the tag You can only specify this tag once, otherwise it will only take the last one's values.

    Example:

    
      
        FileSystem
        Release
        Any CPU
        
        True
        True
        C:\inetput\mysite
        False
        web.config;mysite.sln;App_Code\DevClass.cs;
      
    
    

    Make sure that the tag DeleteExistingFiles is set to False

提交回复
热议问题