-
Notifications
You must be signed in to change notification settings - Fork 4
Gendarme.Rules.Ui.UseSTAThreadAttributeOnSWFEntryPointsRule(git)
Assembly: Gendarme.Rules.Ui
Version: git
This rule checks executable assemblies, i.e. *.exe's, that reference System.Windows.Forms to ensure that their entry point is decorated with [[System.STAThread|http://msdn.microsoft.com/library/System.STAThreadAttribute.aspx]] attribute and is not decorated with [[System.MTAThread|http://msdn.microsoft.com/library/System.MTAThreadAttribute.aspx]] attribute to ensure that Windows Forms work properly.
Bad example #1 (no attributes):
public class WindowsFormsEntryPoint {
static void Main ()
{
}
}
Bad example #2 (MTAThread)
public class WindowsFormsEntryPoint {
[MTAThread]
static void Main ()
{
}
}
Good example #1 (STAThread):
public class WindowsFormsEntryPoint {
[STAThread]
static void Main ()
{
}
}
Good example #2 (not Windows Forms):
public class ConsoleAppEntryPoint {
static void Main ()
{
}
}
You can browse the latest source code of this rule on github.com
Note that this page was autogenerated (3/17/2011 1:55:44 PM) based on the xmldoc
comments inside the rules source code and cannot be edited from this wiki.
Please report any documentation errors, typos or suggestions to the
Gendarme Mailing List. Thanks!