1

I currently have two MVC projects in two solutions which will share a fair bit of look and feel but very different functionality. As such they have different solutions to manage their code. Everything is being stored in TFS repositories.

Currently any shared C# code is managed through class libraries and while this is great for the C# code there doesn't appear to be a similar way to do this for JavaScript or CSS files. Is there a best practices way to handle shared JS and CSS files between separate solutions in TFS specifically or just in solution files in general?

To be clear what I mean when I say "shared," it should have the following criteria:

  1. File has the same name in both solutions.
  2. Editing the file in solution A results in those changes being applied to that file in solution B.
  3. Ideally this will be transparent to the developer.
Mykroft
  • 13,077
  • 13
  • 44
  • 72
  • Can you create this shared library in its own project, and then add that existing project to each of your solutions? – FlyingStreudel Feb 22 '13 at 21:56
  • Can you access javascript files from other projects? I was under the impression they all need to be within one project. – Mykroft Feb 22 '13 at 21:58
  • They do need to be in one project, but that project can be shared between solutions. – FlyingStreudel Feb 22 '13 at 22:02
  • The problem I have is I need to share JS and CSS files between different projects in different solutions. I'll edit the question to make this more clear. – Mykroft Feb 25 '13 at 14:08

2 Answers2

1

You can create a separate project (say "CommonJsCss") that contains all of the shared .js and .css files. Then just include that project in both Solution A and Solution B.

C. Dragon 76
  • 9,882
  • 9
  • 34
  • 41
0

why don´t you put your files in a folder, let´s say 'c:\myprojects\shared\javascripts' and include the folder in all the solutions you need it to be? all code changes will be usable for the other project. Also, you can define your own bundles in each solution including those files.

JulioCT
  • 1,057
  • 8
  • 7