+ [CanBeNull] public object Test() { return null; }
+ public void UseTest() {
+ var p = Test();
+ var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
+ }
+
+ [NotNull] public object Foo() {
+ return null; // Warning: Possible 'null' assignment
+ }
+
+ [StringFormatMethod("message")]
+ public void ShowError(string message, params object[] args) { /* do something */ }
+ public void Foo() {
+ ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
+ }
+
+ public void Foo(string param) {
+ if (param == null)
+ throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol
+ }
+
+ internal class Foo : INotifyPropertyChanged {
+ public event PropertyChangedEventHandler PropertyChanged;
+ [NotifyPropertyChangedInvocator]
+ protected virtual void NotifyChanged(string propertyName) { ... }
+
+ private string _name;
+ public string Name {
+ get { return _name; }
+ set { _name = value; NotifyChanged("LastName"); /* Warning */ }
+ }
+ }
+
+ Examples of generated notifications:
+ Function Definition Table syntax:
+
+ [ContractAnnotation("=> halt")]
+ public void TerminationMethod()
+
+ [ContractAnnotation("halt <= condition: false")]
+ public void Assert(bool condition, string text) // regular assertion method
+
+ [ContractAnnotation("s:null => true")]
+ public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty()
+
+ // A method that returns null if the parameter is null, and not null if the parameter is not null
+ [ContractAnnotation("null => null; notnull => notnull")]
+ public object Transform(object data)
+
+ [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")]
+ public bool TryParse(string s, out Person result)
+
+ [LocalizationRequiredAttribute(true)]
+ internal class Foo {
+ private string str = "my string"; // Warning: Localizable string
+ }
+
+ [CannotApplyEqualityOperator]
+ class NoEquality { }
+ class UsesNoEquality {
+ public void Test() {
+ var ca1 = new NoEquality();
+ var ca2 = new NoEquality();
+ if (ca1 != null) { // OK
+ bool condition = ca1 == ca2; // Warning
+ }
+ }
+ }
+
+ [BaseTypeRequired(typeof(IComponent)] // Specify requirement
+ internal class ComponentAttribute : Attribute { }
+ [Component] // ComponentAttribute requires implementing IComponent interface
+ internal class MyComponent : IComponent { }
+
+ [Pure] private int Multiply(int x, int y) { return x * y; }
+ public void Foo() {
+ const int a = 2, b = 2;
+ Multiply(a, b); // Waring: Return value of pure method is not used
+ }
+
+ [ActionName("Foo")]
+ public ActionResult Login(string returnUrl) {
+ ViewBag.ReturnUrl = Url.Action("Foo"); // OK
+ return RedirectToAction("Bar"); // Error: Cannot resolve action
+ }
+
To set up the target in the configuration file,
@@ -10767,7 +16372,7 @@
To set up the target in the configuration file,
@@ -10794,7 +16399,7 @@
To set up the target in the configuration file,
@@ -10855,6 +16460,15 @@
To set up the target in the configuration file, @@ -11327,12 +16959,24 @@ Note that the Error option is not supported on .NET Compact Framework.
To set up the target in the configuration file,
@@ -11770,7 +17463,7 @@
To set up the target in the configuration file,
@@ -11829,6 +17522,34 @@
- To set up the target in the configuration file, - use the following syntax: -
-
- - The result is: -
-
- - To set up the log target programmatically similar to above use code like this: -
-,
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- To set up the target in the configuration file, @@ -12430,6 +18709,63 @@
To set up the target in the configuration file,
@@ -12568,59 +18933,6 @@
Gets the list of logs gathered in the
- To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- The result is a message box: -
-
- - To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
-
To set up the target in the configuration file,
@@ -12752,6 +19064,26 @@
To set up the target in the configuration file,
@@ -12832,7 +19164,7 @@
To set up the target in the configuration file,
@@ -12859,7 +19191,7 @@
To set up the target in the configuration file,
@@ -12962,331 +19294,11 @@
- To set up the target in the configuration file, - use the following syntax: -
-
- - The result is: -

- To set up the target with coloring rules in the configuration file, - use the following syntax: -
-
-
-
- - The result is: -


- To set up the log target programmatically similar to above use code like this: -
-
- ,
-
-
- for RowColoring,
-
-
- for WordColoring
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
-
To set up the target in the configuration file,
@@ -13388,7 +19400,7 @@
Asynchronous target wrapper allows the logger code to execute more quickly, by queueing
@@ -13774,7 +19812,7 @@
To set up the target in the configuration file,
@@ -13813,7 +19851,7 @@
This example causes the messages to be written to server1, and if it fails, messages go to server2.
@@ -14006,7 +20044,7 @@This example causes the messages not contains the string '1' to be ignored.
@@ -14052,7 +20090,7 @@
This example causes the messages to be written to either file1.txt or file2.txt
chosen randomly on a per-message basis.
@@ -14269,7 +20307,7 @@
This example causes each log message to be repeated 3 times.
@@ -14312,7 +20350,7 @@
This example causes each write attempt to be repeated 3 times,
sleeping 1 second between attempts if first one fails. This example causes the messages to be written to either file1.txt or file2.txt.
Each odd message is written to file2.txt, each even message goes to file1.txt.
@@ -14502,7 +20540,7 @@
This example causes the messages to be written to both file1.txt or file2.txt
update SomeTable
+ set ComplexTypeColumn.SomeProperty()
+ where Id = 2
+ Database.SetInitializer<TTransactionContext>(null) where TTransactionContext is the type of the resolved context.
+ min(random(1, 1.1) * (2 ^ retryCount - 1), maxDelay)
+ The true which means that EF will continue with the assumption
+ that the provider has the necessary types/resources rather than failing fast.
+ /*...*/ containing the specified text.
+
+
+
+ /*...*/ containing the specified text.
+ /*...*/ containing the specified text.
-
-
-
- /*...*/ containing the specified text.
-
Tables[0].DefaultView[0].Price in C# or
- Tables(0).DefaultView(0).Price in Visual Basic.
-
- Tables[0].DefaultView[0].Price in C# or
- Tables(0).DefaultView(0).Price in Visual Basic.
-
- A flag to indicate whether an error should be thrown if no token is found.
-
+
+
+
+
-
+
+
+
-
- Info will exclude Verbose messages and include Info,
+ Warning and Error messages.
+
+ Info will exclude Verbose messages and include Info,
- Warning and Error messages.
- Info will exclude Verbose messages and include Info,
+ Warning and Error messages.
+ Info will exclude Verbose messages and include Info,
- Warning and Error messages.
-