我应该版本的ASP.NET Web Site项目怎么样? [英] How should I version an ASP.NET Web Site project?

查看:161
本文介绍了我应该版本的ASP.NET Web Site项目怎么样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.NET网站项目,我想显示版本号和发布日期,但我不知道如何最好地确定这些。例如,下面的code只是输出 0.0.0.0

I've got an ASP.NET Web Site project and I'd like to display a version number and publish date, but I'm not sure how best to determine these. For example, the following code just outputs 0.0.0.0

LabelVersion.Text = Assembly.GetExecutingAssembly().GetName().Version.ToString();

我应该以某种方式在编译时间确定程序集版本和存储呢?我使用CruiseControl.Net用的MSBuild。

Should I determine the assembly version somehow during build time and store this? I'm using CruiseControl.Net with MSBuild.

推荐答案

使用好执行的程序集时并不需要一个很好的选择,因为执行的程序集将是你的Web服务器。但是,你可以得到的版本开来被此DLL中实现一个类型包含的DLL。

Well using the executing assembly is not neccessary a good choice as the executing assembly will be your web server. However, you could get the version off an included dll from a type that is implemented by this dll.

typeof(myClass).Assembly.GetName().Version.ToString()

这篇关于我应该版本的ASP.NET Web Site项目怎么样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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