Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to share CSS file across multiple projects in Visual Studio 2012?

I have a Visual Studio Project Solution which consists of 3 projects. I want the CSS to be shared by these 3 projects in the VS Solution to minimize the changes since all of them are using the same CSS rules.

How can I achieve this? I tried the Add As Link function but the project does not seem to use the linked CSS.

Thanks.

like image 363
vincent Avatar asked Mar 17 '14 08:03

vincent


Video Answer


1 Answers

This related question gives a very easy step-by-step overview of how to use "Add As Link".

Note that your linked files will not be accessible while debugging your project, unless you add a task to your Project File to manually copy your linked files as described here.

Example:

<Target Name="CopyLinkedContentFiles" BeforeTargets="Build">
    <Copy SourceFiles="%(Content.Identity)" 
          DestinationFiles="%(Content.Link)" 
          SkipUnchangedFiles='true' 
          OverwriteReadOnlyFiles='true' 
          Condition="'%(Content.Link)' != ''" />
</Target>
like image 200
Mac Avatar answered Sep 22 '22 20:09

Mac