3

It seems to be impossible/hard to share views between several asp.net mvc 3 projects. At least, that's what Google tells me. Please correct me if I am wrong ...

What's about css and js files? Did someone do this already? If so, what is the best practice to achieve this (within a vs studio 2010 solution with several asp.net mvc 3 projects)?

Just curious, is it possible to share css and js between mvc3 areas?

cs0815
  • 16,751
  • 45
  • 136
  • 299
  • You could branch/clone from your main version control system repository. – jrummell Mar 19 '13 at 17:51
  • I use svn. not sure how this would work if the whole solution is in the same repository ... – cs0815 Mar 19 '13 at 17:53
  • Just learning a bit about areas (see for example:http://www.iwantmymvc.com/2011-02-15-mvc-3-areas-and-shared-layouts-part-2) How about areas? – cs0815 Mar 25 '13 at 08:32

2 Answers2

1

Since you mention svn - it has "svn:externals" property that lets you map a folder (even from a different repository) to a location under the web site root folder. We used it with success to reuse multiple library tools with external resources (scripts, css files, images and views) in a number of MVC applications.

Igor
  • 15,833
  • 1
  • 27
  • 32
  • could you please provide some more details? – cs0815 Mar 25 '13 at 09:45
  • Not really - that's why I asked for more information. To be honest, I am more looking into a portable area solution right now. Not sure whether this will work though so I keep my options open. Thanks anyway. – cs0815 Mar 25 '13 at 16:50
  • I don't understand your last comment. This is about svn:externals - http://svnbook.red-bean.com/en/1.0/ch07s03.html . When you have more specific questions - you are welcome to ask. – Igor Mar 25 '13 at 16:57
1

There is a cool way to share js, cshtml, css etc. files using "Add as Link" feature of VS. There is a great answer here describing the whole process. Also dont forget to add a build task to copy the files on build so you'd be able to debug them.

Community
  • 1
  • 1
apostolov
  • 1,646
  • 16
  • 20