使用一个母版页,并从项目的资产到另一个项目的最佳方法 [英] Best way to use a master page and its assets from a project into another project

查看:343
本文介绍了使用一个母版页,并从项目的资产到另一个项目的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在TFS创建(是的,不幸的)可重复使用code和资源的项目在其他项目中重用。这个项目有一个母版页,后面(丑名)其code,少数几类可重复使用code和静态资产,像JavaScrit和CSS文件。

I wanna create in TFS (yes, sadly) a project with reusable code and resources to be reused in other projects. This project has a master page, its code behind (ugly name), a few classes with reusable code, and static assets like JavaScrit and CSS files.

我能够在项目中的引用添加到该项目的可重复使用。我能够创建其类的对象。

I'm able to add in a project the reference to this reusable project. I'm able to create objects of its classes.

我再加入(该项目单击鼠标右键>添加现有项>选择文件系统上的母版页)的母版页到本地项目。就这样,我可以(在项目单击鼠标右键>添加新项>与母版页网页表单,选择远程母版页)创建一个ASP页面,并使用它。

I then add that master page into local project (RightClick on the project > add existing item > select the master page on file system). With that, I can create an asp page (RightClick on the project > add new item > web form with master page, select the "remote" master page) and use it.

但是当我运行该项目,打开页面时与所有资产破引用。

But when I run the project, the page is opened with broken references to all assets.

我需要创建每个文件夹和手动之一添加每项资产的文件之一。和每一个它创建了可重用的项目中的新资源文件的时候,我需要将其添加到消耗它的每个项目。这是深深麻烦。

I'd need to create each folder and add each asset file one by one manually. And every time it's created a new asset file on the reusable project, I'd need to add it to each project that consumes it. That's deeply troublesome.

有没有办法做到这一点补充现有的文件到整个文件夹,并保持它的可重复使用的项目同步的?通过同步的,我包括能够改变他们在当地的项目,并让他们更新的可重复使用的项目,能够提交,等等。

Is there a way to do this add existing file into a whole folder, and keep it synched from the reusable project? By synched, I include being able to change them in local project and have them updated on reusable project, be able to commit, etc.

我可以用结,使一个文件夹的NTFS卷影副本的链接到另一个,但随后的文件将在TFS被复制,如果没有它知道他们是唯一的文件。我希望做TFS端此复制,因此其处理synching,合并,冲突,锁具等。

I could use junction to make a NTFS shadow link of one folder to another, but then files would be replicated on TFS, without it knowing they are a unique file. I'd like to do this replication on TFS-side, so that it handles synching, merging, conflicts, locks, etc.

推荐答案

我做到了。我它嵌入到DLL

这是一个有点棘手,该教程一些code不工作了。但是,在此基础上我做它的工作。

It was a little tricky and some code in that tutorial doesn't work anymore. But based on it I made it work.

当ASPX / ascx的文件会被从文件系统读取,它的读取,而不是从DLL资源。一个配置将其添加到DLL。

When the aspx/ascx file is gonna be read from file system, it's instead read as resource from the DLL. A config adds it into the DLL.

我认为它应该在不同的解决方案的项目甚至工作。只要DLL被发现的VisualStudio,或者它能够识别项目并编译它DLL,它应该工作。

I think it should work even for projects in different solutions. As long as the DLL is found by VisualStudio, or it is able to identify the project and compile its DLL, it should work.

这篇关于使用一个母版页,并从项目的资产到另一个项目的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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