开发者

Macro for build date in C#

开发者 https://www.devze.com 2023-01-24 05:19 出处:网络
This related question deals with the retrieval of an app\'s build date in C#, but there\'s gotta be a more efficient way to do it. So here\'s a little idea I had...

This related question deals with the retrieval of an app's build date in C#, but there's gotta be a more efficient way to do it. So here's a little idea I had...

Does Visual C# have a compiler macro that will insert the build date on a given position when the project is being compiled? It would be nice if the compiler could auto-generate the build date that will be displayed in my app's About screen. After all, having to change the date manually every time is a pain in 开发者_开发技巧the neck.


I think no.
Here is the list of c# preprocessor directives: http://msdn.microsoft.com/en-us/library/ed8yd1ha(vs.71).aspx

We are using msbuild with generate assemblyinfo task for such a thing. it is easy and works like a charm.

PS
Also you can modify project file *.proj and add this custom task into it.

0

精彩评论

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