使用 Team Foundation System 进行网站版本控制
我们有一个网站项目(不是 Web 应用程序),并且需要一种方法来跟踪网页上的版本更改。 .dll 没有问题,问题在于跟踪生产服务器中网页的当前版本。
有没有办法用 TFS 做到这一点?我在想也许有一个插件会自动在每个修改的网页上物理地放置一些注释代码,例如指示版本号和最后修改日期。但我真的在这里迷失了。
我知道一种替代方法是将项目类型更改为 Web 应用程序,但是,它是一个大型应用程序,并且将是一个涉及大量测试的大型项目。
编辑:我最终需要什么:
我需要一种方法来识别生产服务器上网页的版本。就像我说的那样,这对于 dll 来说很简单,因为它们带有自己的版本,但网页的文件本身没有任何版本控制。这样我们就可以检查生产服务器,查看文件并知道它是什么版本。
We have a Web Site Project, (not a Web Application), and we need a way to track version changes on web pages. The .dlls are no problem, the problem is keeping track of the current version of a web page in the production server.
Is there a way to do this with TFS? I was thinking maybe a plugin the automatically placed some commented code physically on each modified web page indicating a version number and last modified date, for example. But I am really at a lost here.
I know one alternative would be to change the project type to Web Application, however, it's a big app and that would be a big project involving a lot of testing.
EDIT: What I ultimately need:
I need a way to identify the version of a web page on the production server. Like I said this is simple with dlls because they carry their version, but web pages don't have any versioning on the file itself. So that we can check the production server, look at a file and know which version it is.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我有一篇博客文章解释如何做到这一点(带有 TFS 2010 版本的链接)。
它的核心涉及创建一个包含内部版本号的 version.txt 文件,并使该信息在网站上可见。如果您想将其硬编码到每个页面中,您可以调整流程以将该 version.txt 嵌入到每个页面的 HTML 中。
I have a blog post explaining how this can be done (with a link to a TFS 2010 version).
At the core it involves creating a version.txt file with the build number in it and making this information visible on the site. If you want to hardcode this into every page, you could tweak the process to embed that version.txt in the HTML of each and every page isntead.
我的一位同事通过构建一个 Visual Studio Addin 解决了这个问题,该插件显示所有更改的网页文件,并让您可以选择设置下一个版本或自己定义一个版本并将其写入文件。
One of my co-workers solved this problem by building a Visual Studio Addin which shows all the changed web page files and gives you the option to set the next version or define one yourself and write it to the file.