开发者

Set constant when compiling in C#

开发者 https://www.devze.com 2023-01-16 09:17 出处:网络
I am using XNA 3.1 to develop a small game and I want to add the following two features: 1) Increment the build value every time I compile

I am using XNA 3.1 to develop a small game and I want to add the following two features:

1) Increment the build value every time I compile

2) Set the date/time of compilation

I want to be able to set the Date/Time of co开发者_如何学Gompile in the Window Title (like Crysis)

I found this but I need more details. I am using Visual Studio 2008.

Thanks,


You can set the assembly version to be automatically updated when you build by setting it's build number and revision number to * in your AssembyInfo.cs file:

[assembly: AssemblyVersion("1.0.*")]

Now the build number can be read from the assembly and you can use this to determine the date when your program was built. Check the documentation for the AssemblyVersionAttribute for more information.


You can use this. It should do all that you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号