Wikipedia:Reference desk/Archives/Computing/2019 October 22

= October 22 =

Sharing JavaScript / CSS files between projects in Visual Studio?
I am using Microsoft Visual Studio 2015 at work to develop an ASP.NET Core web application in C#, using JavaScript and CSS on the browser side.

Here's the thing. The system is actually a solution consisting of two separate ASP.NET Core web application projects, both in C#, using JavaScript and CSS. One of the projects has a fully working set of JavaScript and CSS files in the  folder. I'd like to use the same files in another project, but haven't found a way to refer to the files directly across projects so I could reuse them. In the end I resorted to copy-pasting the files as separate copies, but it would be easier to maintain if there were direct file references. Is this possible? J I P &#124; Talk 20:01, 22 October 2019 (UTC)


 * The usual term for this is a library. Try searching for that term in their help files or online. SinisterLefty (talk) 20:09, 22 October 2019 (UTC)


 * Does this mean I can make my own library? Note that the JavaScript and CSS files in question are the company's own proprietary code, which I can use in source code form, but can't be published publicly online. J I P  &#124; Talk 21:19, 22 October 2019 (UTC)


 * Well, unless you actually intend to change them, the copy-and-paste method should be fine. If you do intend to change them, that's when you need to find a way to set up a library (you should also change the name to avoid confusion with their version). I don't know what native capabilities they have to set up a library, but if they don't support that, you could also do so yourself, by maintaining an outside folder with those files, making any changes there, then copy-and-pasting to the project(s) when any change is made. (You'd need to keep a list of which files are used in which projects in that folder, too.) SinisterLefty (talk) 21:49, 22 October 2019 (UTC)