strong naming with build process

  • Thread starter Thread starter alex
  • Start date Start date
A

alex

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?
 
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.
 
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!
 
Back
Top