使用Visual Studio或TFS在项目之间共享资产(图像/css/js) [英] Sharing assets (images/css/js) between projects using either Visual Studio or TFS

查看:105
本文介绍了使用Visual Studio或TFS在项目之间共享资产(图像/css/js)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在一种在不同项目之间共享视觉资产的有效方法?

Is there an effective way to share visual assets between different projects?

这将包括图像,CSS和JavaScript.

This would include images, CSS and JavaScript.

我查看了以下似乎无法回答此问题的堆栈溢出问题:

I've looked at the following Stack Overflow questions which don't seem to answer this:

  • Sharing css/javascript/images between different projects in Visual Studio
  • Visual Studio - Resource (CSS/JS/Images) sharing between web projects
  • Handling common JavaScript files in Visual Studio 2010

我们使用TFS,不确定是否可以使用某些东西?

We make use of TFS, not sure if that might have something we can use?

推荐答案

没有内置的ASP.NET MVC可以让您生成到其他ASP.NET应用程序的链接.所有帮助程序都针对当前应用程序执行相对的控制器操作.如果所有静态文件都位于另一个ASP.NET应用程序(一种自定义CDN)中,则可以在web.config中定义该应用程序的基本位置,然后构建将为这些资源提供服务的自定义帮助程序:

There's nothing built-in ASP.NET MVC that will allow you to generate links to other ASP.NET applications. All the helpers work with relative controller actions for the current application. If all your static files are located inside another ASP.NET application (a sort of custom CDN) then you could define the base location of this application in your web.config and then build custom helpers that will serve those resources:

@Html.Resource("/foo.js", "text/javascript")

,自定义帮助程序将为该外部资源生成一个绝对URL.

and the custom helper will generate an absolute url to this external resource.

这篇关于使用Visual Studio或TFS在项目之间共享资产(图像/css/js)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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