Visual Studio: Set the Build Action for an Entire Folder
1 min read
1 min read
I'm sure you already encountered this problem, right? In my specific case I have a folder called "frontend" with a
bunch of JavaScript, CSS and view template (EJS) files; my rich JavaScript client basically. I just need them when
starting my app in my local Visual Studio development server but they should not be copied when publishing. Why?
Because they walk through a Minifier and Linter before. The solution: set the Build Action
to None
.
That won't work on an entire folders however, sigh...
<Content Include="frontend\snip\snip\somefile.js" />with
<None Include="frontend\snip\snip\somefile.js" />I'll leave the regex for you ;).
Ctrl+F
and enter your regex. Then you click the "Find All"
button and it will place a cursor automatically on all of the found occurrences such that you can just
edit those lines. Awesome!!