How to set "SpecialBuild" VersionInfo in C#/VS.NET?

D

Daniel Redman

I'm searching all over for how to set the "FileVersionInfo.SpecialBuild"
property for my C# app from the VS.NET IDE/build environment, and all I can
see is how to read the property from an external app file. I need to set
this string in order to embed licensing info for an auxiliary DLL to read.

When I Google for this, all I see is how to do it with a ".rc" file, but
AFAIK I'm not using ".rc" files in my project (I see several "resx" files
and some of these "VersionInfo" values seem to be set in the Assembly, but
not "SpecialBuild").

What's up with that?
 
G

Grant Richins [MS]

Good news and Bad news. The good news is that you've already found most of
your answers. The bad news is that the IDE won't help you much, if any, to
do this. You are correct that you're not using .rc files in your project.
What is happening right now is that the compiler is generating the
equivalent of an .rc file for you and using that to set your output's file
version info. The complier generates this based on several of the assembly
attributes. Unfortunately there is no attribute that correlates with the
SpecialBuild field. So if you really want to set it, you'll have to
manually create the .rc file (the VC project system has a great .rc file
editor which includes a rather nice file version info editor). Hopefully
you're using 2003 or somebody else's build system because you'll need some
custom build rules. As a pre-build step you need to run rc.exe to compile
the .rc file to a .res file. Then you need to find some way to pass this
file to the C# compiler's /win32res command-line option (I can't remember
off the top of my head if this is even possible).
 
M

Marc Scheuner [MVP ADSI]

The bad news is that the IDE won't help you much, if any, to
do this. The complier generates this based on several of the assembly
attributes. Unfortunately there is no attribute that correlates with the
SpecialBuild field.

Is this something that's gonna be improved in Whidbey??

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
G

Grant Richins [MS]

There are no plans to add more attributes like this. I think the
IDE/project system team is working on exposing more of the command-line
options as project settings.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top