Groups | Blog | Home
all groups > c# > may 2005 >

c# : strong naming with build process


alex
5/9/2005 10:52:38 PM
I've got a control I need to release as both a regular and strong
named version. The problem I'm running into is that it seems without
creating a new project file and assemblyinfo.cs file I don't see a way
I can compile both as a build one after the other. Are there any
command line arguments or something I can use when compiling to keep
me from having to add a new csproj and cs file?
Bob Powell [MVP]
5/10/2005 12:00:00 AM
You can use a preprocessor directive in the AssemblyInfo file such as....

#define STRONGNAME << at the top of the AssemblyInfo.cs file

.....

.....

#if STRONGNAME
[assembly: AssemblyKeyFile("my_keyfile.snk")]

#else
[assembly: AssemblyKeyFile("")]

#endif

When you don't want the strong named version just comment out the initial
#define directive.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





[quoted text, click to view]

alex
5/10/2005 6:38:33 PM
ohhh! that's a great idea. Even though it's a cs file it didn't
occur to me that I could preprocessor it. thanks, I'll do just that!


On Tue, 10 May 2005 09:08:09 +0200, "Bob Powell [MVP]"
[quoted text, click to view]
AddThis Social Bookmark Button