3

When publishing a Web Application (MVC in my case) via File Systemin Web Publish setting, most of the *.scss & *.less files get deployed as well.

How do I configure a Visual Studio project so that it does not deploy these files?

Jake
  • 3,142
  • 4
  • 30
  • 48
Parimal Raj
  • 20,189
  • 9
  • 73
  • 110
  • Is possible related question [Exclude files from web site publish in Visual Studio](http://stackoverflow.com/q/650875/4519059) ? – shA.t Jun 14 '16 at 19:03

2 Answers2

10

I believe setting "Build action" to "None" and "Copy to output directory" to "Never" should work. You can do it in property window of the file. Right click the file in solution explorer and click properties

Liero
  • 25,216
  • 29
  • 151
  • 297
  • This is the correct answer, and the one I use for things like build files, intermediary files, log directories, etc. Files within a given project are automatically deployed, but can be set to never deploy. – Jake Jun 16 '16 at 19:37
1

Visual Studio deploys only those files that are included in the project, visible in project explorer and also "Build Action" ="Content" configured with "Copy to Output Directory" = "Copy Always" or "Copy if newer" then on publish, such files are copied to output directory.

As *.scss & *.less are just configuration files that are used to generate final output files to be available in output directory and so these never required in production after publish, but as these files required to be included in project file so these files should have properties configured as: Build Action: Content Copy to Output Directory: Do not copy

  • This is not correct. See the other answer for the reason why. – DavidG Jun 17 '16 at 13:54
  • DavidG, I edited the comment to elaborate it in detail. This is correct explanation as I am also using *.scss files in project with same settings – Technorider Jun 17 '16 at 19:26