Wednesday, March 2, 2016

How to include generated files in Visual Studio Web Deployment Package without adding them to Source Control

When using Web Deployment the default is to only have it include the files that are needed to run the application. You can tell Visual Studio to include all files in the project or project folder but that could be messy.

Let's say we want to generate CSS from SCSS. In that case we wouldn't want to include the generated file into Source Control but rather generate it whenever we build or change some SCSS.

Now comes the tricky part. In order to include the generated file in the project so that Web Deployment would include it but not add it to Source Control we can use a .tfignore file. I've created one and put it in the solution root. To have it ignore the generated CSS file in my web project we simply have to add this line:

One confusing bit is when you add the generated file to your project it still shows up in Pending Changes. Just Undo that change and it won't show up as a pending change anymore.

One last thing piece to the puzzle is to hide the generated file from Solution Explorer since we don't ever want to edit that file manually.

Edit the project file, find the generated file, add the Visible tag inside the Content tag and set it to false:
<Content Include="Static\SCSS\site.css">


Aruna Ram said...

This post is very different and unique information. It's a very nice post and very attractive to me. Keep posting...
Spark Training in Chennai
Spark Training
Pega Training in Chennai
Linux Training in Chennai
Social Media Marketing Courses in Chennai
Power BI Training in Chennai
Tableau Training in Chennai
Excel Training in Chennai
Oracle DBA Training in Chennai
Spark Training in Valachery

Unknown said...

Appreciation is a wonderful thing...thanks for sharing kepp it up.Visual SEO Studio Crack
Ashampoo Soundstage Crack
Native Instruments Massive Crack
IDM Crack 6.38 Build 16
WinRAR Crack
IOBIT Uninstaller Pro Key

shakeel said...

Keep up the good writing.
Native Instruments Massive Crack

zunairahashmi said...

Thanks For Post which have lot of knowledge and informataion thanks.... Native Instruments Massive Crack
Native Instruments Massive Crack
Native Instruments Kontakt Crack
Native Instruments kontakt Crack

Anonymous said...

Thank you so much for sharing.
autodesk-powermill crack
kls backup pro crack
airparrot crack
auslogics boostspeed premium crack
snaptube crack
aurora hdr crack

Rana said...

I hypothesized that most people living in Israel (and globally) have unsafe WiFi passwords that can be easily cracked or even guessed by curious neighbors or malicious actors.WiFi Password Hacker Online

Samia Beel said...

The latest version 2201.1 with 58.80 MB, Pandora One APK is the perfect app for those who breathe with the beats. It is basically a music app. Pandora One APK