Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Public constant
Message
De
29/03/2013 10:18:07
 
 
À
18/03/2013 15:02:04
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01568710
Message ID:
01569533
Vues:
54
This message has been marked as a message which has helped to the initial question of the thread.
>Not directly relevant but, IAC, it is much safer to use a static readonly rather than a constant. If you reference a constant defined in one assembly in another then it is cast in stone at compile time. If you subsequently change that value other assemblies would still be using the old value unless recompiled.

I know this is an old thread, but I've been away from the UT for a couple of weeks.

Another thing that I ran into with using constants is that our obfuscator wouldn't obfuscate them. I switched all my constants to static readonly.

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform