views:

49

answers:

1

I'm trying to get my build number into the web.config of an ASP.Net MVC project (long story, but there is a reason)... something like this:

<appSettings>
    <add key="version" value="1.0.3936.27150" />
</appSettings>

Right now, I'm doing it with an executable on the post-build event by looking at the assembly to get the version and stuff that into the web.config. It works, but isn't exactly what I was looking for.

Any easy way to do this easier / cleaner? Thanks for any advice / suggestions.

A: 

You have a few options here, the first being the one you picked, which is old skewl. The next option would be to use a Visual Studio Macro... this will only work in Visual Studio and on the system that it was configured on. The next two options would be the best. Use an MSBuild script as a post build event... or a NAnt script as a post build event to make the mod. I would lean in favor of the NAnt my self, but then I have a black belt in NAnt. :-)

CrazyDart
Thanks- I'll probably go the MSBuild script option since I'm not familiar with NAnt.
Greg Kurts