在 Visual Studio 中的不同项目之间共享 css/javascript/images [英] Sharing css/javascript/images between different projects in Visual Studio

查看:48
本文介绍了在 Visual Studio 中的不同项目之间共享 css/javascript/images的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎想不出最有效的方法来做到这一点.

I can't seem to figure out the most efficient way to do this.

例如,我在两个项目中都需要一些 js 文件(在同一个解决方案中),如何在不复制实际物理文件的情况下包含它们,我宁愿不这样做?图片和 css 文件也是如此.

For example, I have some js files that are needed in both projects(within the same solution), how do I include them without duplicating the actual physical files, which I would rather not do? Same goes for images and css files.

我还想知道将 js 资源包含在其他解决方案/项目中的最佳方法是什么.

I would also like to know what's the best way to generalize this for including the js resources in other solutions/projects.

现在回想起来,VS 似乎确实缺乏一个简单直观的解决方案.

VS really seems to be lacking an easy intuitive solution in this retrospect.

有什么想法吗?

推荐答案

为什么他们在哪个项目中很重要?您真正关心的是它们在您网站上的部署位置,以及从您网站的根目录到它们的路径是什么,对吗?因此,只需选择一个放置它们的位置,并使用该路径引用它们的代码.

Why does it matter which project they are in? All you really care about is where they get deployed on your web site, and what the path to them from the root of your site is, right? So just pick a place to put them and have and code that refers to them use that path.

这篇关于在 Visual Studio 中的不同项目之间共享 css/javascript/images的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆