Visual Studio - Resource (CSS/JS/Images) sharing between web projects

deployment, visual-studio

Solution

You can create a second Web.Resources project for the second site, but link the files from the first resource. I know this means that you have an extra project, but in a way it's good because you have abstract the resources, but still maintained a certain level of separation.

To link files go .... Add--> Existing Item --> Select file(s) --> Beside "Add" there is a down arrow --> Click "Add As Link".

Hope this helps.

Problem

Possible Duplicate: Handling common JavaScript files in Visual Studio 2010 I'm looking to share a common pool of web resources (css/js/images) across multiple web projects. What I'm hoping to do, is create one project file for the resources, e.g.: Common.WebResources, and include it in the Visual Studio solutions for Site1 & Site2. The part I'm looking to solve is setting it up to work with the VS Development Server (the one that gets fired up on F5), and any outer deployment concerns. So we're hoping to wind up with the following projects mapped to the following web directories: - Site1.Web - / - Common.WebResources - /resources In IIS, it would just be a virtual directory. So far with VS Development Server, I've only been able to: - Get them to deploy on different ports (not a lot of use) - Add a post-build event to copy the contents of /resources into Site1.Web My questions are: - What other options are there? - Which do you feel to be the most appropriate, usable & maintainable? (The reason I'd like the resources in a single, separate project is to avoid having to constantly merge a master resources location into each of the consuming sites, and merging back from each fix we make.)

Original source

Related problems