How to make sgen.exe keep the version of the assembly?

白昼怎懂夜的黑 提交于 2019-12-12 16:30:37

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/2179621/how-to-make-sgen-exe-keep-the-version-of-the-assembly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!