How to make different projects share the same front-end resource in visual studio?

I am in visual studio, every project depends on a layout page, but every time I create a new project, I have to copy the previous layout page before I can reference it, and there are some front-end plug-ins and their own js that need to be copied in order to call. Is there any way for different projects to share the same front-end resources (js,css, plug-ins, layout pages).

I"ve tried adding files as links before, but when I refer to these linked js files on the page, I get a 404 error during debugging and I can"t find them.
has also read some articles that say you can create a shared project and add references to other projects, but what I need to reference is not the back-end class, it"s all front-end files, so it"s no good.
which god can tell me the solution!

Apr.30,2021

npm is used more now, isn't it? Npm publish the common resources for a moment, and then use npm install


this should be the 404 caused by the relative path change of the referenced use. If the project is a template made by the back-end language, you can use the back-end language to encapsulate a method to obtain the absolute path


Hello, you can package the razor layout page and its related css, js and images that need to be shared across projects into a nuget package,. Then install the nuget package in the project you need, and you can find relevant tutorials online: https://stackoverflow.com/que.

.
Menu