Sharing assets (images/css/js) between projects using either Visual Studio or TFS

后端 未结 3 1389
太阳男子
太阳男子 2021-01-14 08:03

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

This would include images, CSS and JavaScript.

I\'ve looked at the following S

3条回答
  •  不要未来只要你来
    2021-01-14 08:36

    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")
    

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

提交回复
热议问题