2

I want to create a serialization assembly for my assembly. sgen does it fine, but I can't figure out how to get it to assign the serialization assembly the same version as the source assembly.

Any ideas?

Steven Sudit
  • 19,391
  • 1
  • 51
  • 53
AngryHacker
  • 59,598
  • 102
  • 325
  • 594

1 Answers1

4

sgen seem to take source assembly version by default, it is quite reasonable.

Here is how I run it, there is nothing special:

"...PathToSDK...\Microsoft Visual Studio SDK\sgen.exe" /force /assembly:"$(TargetPath)" /compiler:"\"/keyfile:$(ProjectDir)..\key.snk"\" /compiler:/delaysign-

/force -- to overwrite existing serializer assemblies

/assembly -- path to the assembly, I run it in the post-build event in the VS project settings, so I use the $(TargetPath) variable

/compiler: ... -- csc options, I use them to sign serializer assemblies with the key

Massimiliano
  • 16,770
  • 10
  • 69
  • 112