diff --git a/docs/csharp/misc/cs1911.md b/docs/csharp/misc/cs1911.md index a7b4dc643e303..fdb93d32cdad6 100644 --- a/docs/csharp/misc/cs1911.md +++ b/docs/csharp/misc/cs1911.md @@ -24,7 +24,7 @@ Access to member 'name' through a 'base' keyword from an anonymous method, lambd ## Example The following sample generates CS1911. -``` +```csharp // CS1911.cs // compile with: /W:1 using System; diff --git a/docs/csharp/misc/cs1912.md b/docs/csharp/misc/cs1912.md index 170446852fd0c..27695f656db49 100644 --- a/docs/csharp/misc/cs1912.md +++ b/docs/csharp/misc/cs1912.md @@ -26,7 +26,7 @@ Duplicate initialization of member 'name'. ## Example The following code generates CS1912 because `memberA` is initialized two times: -``` +```csharp // cs1912.cs using System.Linq; diff --git a/docs/csharp/misc/cs1913.md b/docs/csharp/misc/cs1913.md index 21a39ab28e158..c910efc85cbb7 100644 --- a/docs/csharp/misc/cs1913.md +++ b/docs/csharp/misc/cs1913.md @@ -26,7 +26,7 @@ Member 'name' cannot be initialized. It is not a field or property. ## Example The following example generates CS1913: -``` +```csharp // cs1912.cs class A { diff --git a/docs/csharp/misc/cs1914.md b/docs/csharp/misc/cs1914.md index c55b2fdb32297..4de1cee5aedb0 100644 --- a/docs/csharp/misc/cs1914.md +++ b/docs/csharp/misc/cs1914.md @@ -26,7 +26,7 @@ Static field 'name' cannot be assigned in an object initializer ## Example The following code generates CS1914 because the initializer tries to initialize the `TestClass.Number` field, which is `static`: -``` +```csharp // cs1914.cs using System.Linq; public class TestClass diff --git a/docs/csharp/misc/cs1917.md b/docs/csharp/misc/cs1917.md index 5a407790c72b4..cbbcb12b2273e 100644 --- a/docs/csharp/misc/cs1917.md +++ b/docs/csharp/misc/cs1917.md @@ -28,7 +28,7 @@ Members of read-only field 'name' of type 'struct name' cannot be assigned with ## Example The following code generates CS1917: -``` +```csharp // cs1917.cs class CS1917 { diff --git a/docs/csharp/misc/cs1918.md b/docs/csharp/misc/cs1918.md index a8338b2f731ec..7d16253e7e43d 100644 --- a/docs/csharp/misc/cs1918.md +++ b/docs/csharp/misc/cs1918.md @@ -26,7 +26,7 @@ Members of property 'name' of type 'type' cannot be assigned with an object init ## Example The following example generates CS1918: -``` +```csharp // cs1918.cs public struct MyStruct { diff --git a/docs/csharp/misc/cs1920.md b/docs/csharp/misc/cs1920.md index 4061ae4c0d5e5..b1e9a557b0d2b 100644 --- a/docs/csharp/misc/cs1920.md +++ b/docs/csharp/misc/cs1920.md @@ -28,7 +28,7 @@ Element initializer cannot be empty. ## Example The following example generates CS1920: -``` +```csharp // cs1920.cs using System.Collections.Generic; public class Test diff --git a/docs/csharp/misc/cs1922.md b/docs/csharp/misc/cs1922.md index 31f8bdeb922e0..758e5bc222186 100644 --- a/docs/csharp/misc/cs1922.md +++ b/docs/csharp/misc/cs1922.md @@ -30,7 +30,7 @@ Collection initializer requires its type 'type' to implement System.Collections. ## Example The following code produces CS1922: -``` +```csharp // cs1922.cs public class Test { diff --git a/docs/csharp/misc/cs1925.md b/docs/csharp/misc/cs1925.md index 58d13577b4f79..9deb24a95ff7e 100644 --- a/docs/csharp/misc/cs1925.md +++ b/docs/csharp/misc/cs1925.md @@ -26,7 +26,7 @@ Cannot initialize object of type 'type' with a collection initializer. ## Example The following code generates CS1925: -``` +```csharp // cs1925.cs public class Student { diff --git a/docs/csharp/misc/cs1927.md b/docs/csharp/misc/cs1927.md index cfc5d6984649d..c8255eaefc82d 100644 --- a/docs/csharp/misc/cs1927.md +++ b/docs/csharp/misc/cs1927.md @@ -28,7 +28,7 @@ Ignoring /win32manifest for module because it only applies to assemblies. ## Example The following example generates CS1927 when it is compiled with both the **/target:module** and **/win32manifest** compiler options. -``` +```csharp // cs1927.cs // Compile with: /target:module /win32manifest using System; diff --git a/docs/csharp/misc/cs1928.md b/docs/csharp/misc/cs1928.md index 7a5ced1c9dd8a..7fc955ca9feb0 100644 --- a/docs/csharp/misc/cs1928.md +++ b/docs/csharp/misc/cs1928.md @@ -26,7 +26,7 @@ ms.author: "wiwagn" ## Example The following code generates CS1928: -``` +```csharp // cs1928.cs class Test { diff --git a/docs/csharp/misc/cs1929.md b/docs/csharp/misc/cs1929.md index 4c5dd448dd620..177147b6cdb30 100644 --- a/docs/csharp/misc/cs1929.md +++ b/docs/csharp/misc/cs1929.md @@ -26,7 +26,7 @@ Instance argument: cannot convert from 'typeA' to 'typeB'. ## Example The following code generates CS1928 and CS1929: -``` +```csharp // cs1929.cs using System.Linq; using System.Collections; diff --git a/docs/csharp/misc/cs1930.md b/docs/csharp/misc/cs1930.md index d1776ca7a8952..da27dab99f243 100644 --- a/docs/csharp/misc/cs1930.md +++ b/docs/csharp/misc/cs1930.md @@ -26,7 +26,7 @@ The range variable 'name' has already been declared ## Example The following example generates CS1930 because the identifier `num` is used for the range variable in the `from` clause and for the range variable introduced by the `let` clause. -``` +```csharp // cs1930.cs using System.Linq; class Program diff --git a/docs/csharp/misc/cs1931.md b/docs/csharp/misc/cs1931.md index 6c4c6ff1ce539..f4f079da77ac5 100644 --- a/docs/csharp/misc/cs1931.md +++ b/docs/csharp/misc/cs1931.md @@ -26,7 +26,7 @@ The range variable 'variable' conflicts with a previous declaration of 'variable ## Example The following code generates CS1931 because the identifier `x` is used both as a local variable in `Main` and as the range variable in the query expression: -``` +```csharp // cs1931.cs class Test { diff --git a/docs/csharp/misc/cs1932.md b/docs/csharp/misc/cs1932.md index b9887418a6065..3f4fa73a68a3e 100644 --- a/docs/csharp/misc/cs1932.md +++ b/docs/csharp/misc/cs1932.md @@ -28,7 +28,7 @@ Cannot assign 'expression' to a range variable. ## Example The following code generates CS1932 because the type of the range variable cannot be inferred. Cast the value to the intended type to fix the error, as shown in the following example. -``` +```csharp // CS1932.cs using System.Linq; class Test diff --git a/docs/csharp/misc/cs1934.md b/docs/csharp/misc/cs1934.md index c01e2644cc4e5..9a7fc75dacb14 100644 --- a/docs/csharp/misc/cs1934.md +++ b/docs/csharp/misc/cs1934.md @@ -23,14 +23,14 @@ Could not find an implementation of the query pattern for source type 'type'. 'm 1. In the following example, the solution is to just specify the type of the range variable: - ``` + ```csharp var q = from int x in list ``` ## Example The following example shows one way to produce CS1934: -``` +```csharp // cs1934.cs using System.Linq; using System.Collections; diff --git a/docs/csharp/misc/cs1935.md b/docs/csharp/misc/cs1935.md index f65eb378a800c..4f43235598247 100644 --- a/docs/csharp/misc/cs1935.md +++ b/docs/csharp/misc/cs1935.md @@ -26,7 +26,7 @@ Could not find an implementation of the query pattern for source type 'type'. 'm ## Example The following code generates CS1935 because the `using` directive for System.Linq is commented out: -``` +```csharp // cs1935.cs // CS1935 using System; diff --git a/docs/csharp/misc/cs1937.md b/docs/csharp/misc/cs1937.md index d9cc59f1c679d..01f5f07957870 100644 --- a/docs/csharp/misc/cs1937.md +++ b/docs/csharp/misc/cs1937.md @@ -26,7 +26,7 @@ The name 'name' is not in scope on the left side of 'equals'. Consider swapping ## Example The following example generates CS1937. -``` +```csharp // cs1937.cs using System.Linq; class Test diff --git a/docs/csharp/misc/cs1938.md b/docs/csharp/misc/cs1938.md index 1f829fa17f2c2..8d7a6869d2bdc 100644 --- a/docs/csharp/misc/cs1938.md +++ b/docs/csharp/misc/cs1938.md @@ -26,7 +26,7 @@ The name 'name' is not in scope on the right side of 'equals'. Consider swapping ## Example The following code generates CS1938: -``` +```csharp // cs1938.cs using System.Linq; class Test diff --git a/docs/csharp/misc/cs1939.md b/docs/csharp/misc/cs1939.md index fff39811869c7..85e6a3b7b09a1 100644 --- a/docs/csharp/misc/cs1939.md +++ b/docs/csharp/misc/cs1939.md @@ -26,7 +26,7 @@ Cannot pass the range variable 'name' as an out or ref parameter. ## Example The following example generates CS1939: -``` +```csharp // cs1939.cs using System.Linq; class Test diff --git a/docs/csharp/misc/cs1940.md b/docs/csharp/misc/cs1940.md index 33a176bb2f4e9..558dba216ad75 100644 --- a/docs/csharp/misc/cs1940.md +++ b/docs/csharp/misc/cs1940.md @@ -26,7 +26,7 @@ Multiple implementations of the query pattern were found for source type 'type'. ## Example The following code generates CS1940: -``` +```csharp // cs1940.cs using System; //must include explicitly for types defined in 3.5 class Test diff --git a/docs/csharp/misc/cs1945.md b/docs/csharp/misc/cs1945.md index 3491c10fc79b1..57d940c5e7eb4 100644 --- a/docs/csharp/misc/cs1945.md +++ b/docs/csharp/misc/cs1945.md @@ -26,7 +26,7 @@ An expression tree may not contain an anonymous method expression. ## Example The following code generates CS1945: -``` +```csharp // cs1945.cs using System; using System.Linq.Expressions; diff --git a/docs/csharp/misc/cs1947.md b/docs/csharp/misc/cs1947.md index a0b3faa084700..db6649023817b 100644 --- a/docs/csharp/misc/cs1947.md +++ b/docs/csharp/misc/cs1947.md @@ -28,7 +28,7 @@ Range variable 'variable name' cannot be assigned to -- it is read only. ## Example The following code generates CS1947: -``` +```csharp // cs1947.cs using System.Linq; class Test diff --git a/docs/csharp/misc/cs1948.md b/docs/csharp/misc/cs1948.md index af682a239ed2f..0ca984c464213 100644 --- a/docs/csharp/misc/cs1948.md +++ b/docs/csharp/misc/cs1948.md @@ -26,7 +26,7 @@ The range variable 'name' cannot have the same name as a method type parameter ## Example The following example generates CS1948 because the identifier `T` is used for the range variable and for the type parameter on method `TestMethod`: -``` +```csharp // cs1948.cs using System.Linq; class Test diff --git a/docs/csharp/misc/cs1949.md b/docs/csharp/misc/cs1949.md index d7984cc2b216a..e3e372ad6ecfd 100644 --- a/docs/csharp/misc/cs1949.md +++ b/docs/csharp/misc/cs1949.md @@ -26,7 +26,7 @@ The contextual keyword 'var' cannot be used in a range variable declaration. ## Example The following example generates CS1949: -``` +```csharp // cs1949.cs using System; using System.Linq; diff --git a/docs/csharp/misc/cs1950.md b/docs/csharp/misc/cs1950.md index 59a7c431b38d0..12a8c1c912bcd 100644 --- a/docs/csharp/misc/cs1950.md +++ b/docs/csharp/misc/cs1950.md @@ -32,7 +32,7 @@ The best overloaded Add method 'name' for the collection initializer has some in ## Example The following example generates CS1950: -``` +```csharp // cs1950.cs using System.Collections; class TestClass : CollectionBase diff --git a/docs/csharp/misc/cs1951.md b/docs/csharp/misc/cs1951.md index 9355d700c7b84..1fa562e89bd7a 100644 --- a/docs/csharp/misc/cs1951.md +++ b/docs/csharp/misc/cs1951.md @@ -26,7 +26,7 @@ An expression tree lambda may not contain an out or ref parameter. ## Example The following example generates CS1951: -``` +```csharp // cs1951.cs using System.Linq; public delegate int TestDelegate(ref int i); diff --git a/docs/csharp/misc/cs1952.md b/docs/csharp/misc/cs1952.md index 697581de1da41..2c9a7199a48a5 100644 --- a/docs/csharp/misc/cs1952.md +++ b/docs/csharp/misc/cs1952.md @@ -26,7 +26,7 @@ An expression tree lambda may not contain a method with variable arguments ## Example The following code produces CS1952: -``` +```csharp // cs1952.cs using System; using System.Linq.Expressions; diff --git a/docs/csharp/misc/cs1953.md b/docs/csharp/misc/cs1953.md index e0b19504f7bfc..4aeff752f6723 100644 --- a/docs/csharp/misc/cs1953.md +++ b/docs/csharp/misc/cs1953.md @@ -26,7 +26,7 @@ An expression tree lambda may not contain a method group. ## Example The following example generates CS1953: -``` +```csharp // cs1953.cs using System; using System.Linq.Expressions; diff --git a/docs/csharp/misc/cs1954.md b/docs/csharp/misc/cs1954.md index 1e57d887a43bf..89a953c53f0a5 100644 --- a/docs/csharp/misc/cs1954.md +++ b/docs/csharp/misc/cs1954.md @@ -28,7 +28,7 @@ The best overloaded method match 'method' for the collection initializer element ## Example The following example produces CS1954 because the only available overload of the `Add` list in `MyList` has a `ref` parameter. -``` +```csharp // cs1954.cs using System.Collections.Generic; class MyList : IEnumerable diff --git a/docs/csharp/misc/cs1955.md b/docs/csharp/misc/cs1955.md index 5dc5a6109d351..42bafca884902 100644 --- a/docs/csharp/misc/cs1955.md +++ b/docs/csharp/misc/cs1955.md @@ -26,7 +26,7 @@ Non-invocable member 'name' cannot be used like a method. ## Example The following code generates CS1955 because the code is trying to invoke a field and a property by using the method call operator [()](../../csharp/language-reference/operators/invocation-operator.md). You cannot call a field or property, but you can access the value it stores by using the member access operator ( [.](../../csharp/language-reference/operators/member-access-operator.md) ). -``` +```csharp // cs1955.cs class A { diff --git a/docs/csharp/misc/cs1957.md b/docs/csharp/misc/cs1957.md index e86ba3182a103..452d590952e33 100644 --- a/docs/csharp/misc/cs1957.md +++ b/docs/csharp/misc/cs1957.md @@ -26,7 +26,7 @@ Member 'name' overrides 'method'. There are multiple override candidates at run- ## Example The following code generates CS1957: -``` +```csharp // cs1957.cs class Base { diff --git a/docs/csharp/misc/cs1958.md b/docs/csharp/misc/cs1958.md index 3f873b309dad9..bf43f9a110d24 100644 --- a/docs/csharp/misc/cs1958.md +++ b/docs/csharp/misc/cs1958.md @@ -26,7 +26,7 @@ Object and collection initializer expressions may not be applied to a delegate c ## Example The following code produces CS1958: -``` +```csharp // cs1958.cs public class MemberInitializerTest { diff --git a/docs/csharp/misc/cs1959.md b/docs/csharp/misc/cs1959.md index 921e04c1a7d7f..d9471162a29d5 100644 --- a/docs/csharp/misc/cs1959.md +++ b/docs/csharp/misc/cs1959.md @@ -26,7 +26,7 @@ ms.author: "wiwagn" ## Example The following code produces CS1959 because `null` is not a type. -``` +```csharp // cs1959.cs class Program { diff --git a/docs/csharp/misc/cs2002.md b/docs/csharp/misc/cs2002.md index 8a8fb0ccd9f68..2aa09e3eabfd9 100644 --- a/docs/csharp/misc/cs2002.md +++ b/docs/csharp/misc/cs2002.md @@ -23,7 +23,7 @@ Source file 'file' specified multiple times The following sample generates CS2002: -``` +```csharp // CS2002.cs // compile with: CS2002.cs public class A diff --git a/docs/csharp/misc/cs2005.md b/docs/csharp/misc/cs2005.md index 5e9db43d62e75..5f46561d8e024 100644 --- a/docs/csharp/misc/cs2005.md +++ b/docs/csharp/misc/cs2005.md @@ -24,7 +24,7 @@ Missing file specification for 'option' option ## Example The following sample generates CS2005. -``` +```csharp // CS2005.cs // compile with: /recurse: // CS2005 expected diff --git a/docs/csharp/misc/cs2007.md b/docs/csharp/misc/cs2007.md index cb37a837d26f1..ff81e92d8eb94 100644 --- a/docs/csharp/misc/cs2007.md +++ b/docs/csharp/misc/cs2007.md @@ -21,7 +21,7 @@ Unrecognized command-line option: 'option' The following sample generates CS2007: -``` +```csharp // CS2007.cs // compile with: /recur // CS2007 expected diff --git a/docs/csharp/misc/cs2013.md b/docs/csharp/misc/cs2013.md index dd5cd4a1ab5af..641ad2f058643 100644 --- a/docs/csharp/misc/cs2013.md +++ b/docs/csharp/misc/cs2013.md @@ -21,7 +21,7 @@ Invalid image base number 'value' The following sample generates CS2013: -``` +```csharp // CS2013.cs // compile with: /target:library /baseaddress:x // CS2013 expected diff --git a/docs/csharp/misc/cs2016.md b/docs/csharp/misc/cs2016.md index ef71f34804553..126240be4e3bf 100644 --- a/docs/csharp/misc/cs2016.md +++ b/docs/csharp/misc/cs2016.md @@ -21,7 +21,7 @@ Code page 'codepage' is invalid or not installed The following sample generates CS2016: -``` +```csharp // CS2016.cs // compile with: /codepage:x // CS2016 expected diff --git a/docs/csharp/misc/cs2017.md b/docs/csharp/misc/cs2017.md index 3025f65fd7b37..b779a087151ba 100644 --- a/docs/csharp/misc/cs2017.md +++ b/docs/csharp/misc/cs2017.md @@ -21,7 +21,7 @@ Cannot specify /main if building a module or library The following sample generates CS2017: -``` +```csharp // CS2017.cs // compile with: /main:MyClass /target:library // CS2017 expected diff --git a/docs/csharp/misc/cs2019.md b/docs/csharp/misc/cs2019.md index de61ba0075b5c..c2b341616f96f 100644 --- a/docs/csharp/misc/cs2019.md +++ b/docs/csharp/misc/cs2019.md @@ -21,7 +21,7 @@ Invalid target type for /target: must specify 'exe', 'winexe', 'library', or 'mo The following sample generates CS2017: -``` +```csharp // CS2019.cs // compile with: /target:libra // CS2019 expected diff --git a/docs/csharp/misc/cs2024.md b/docs/csharp/misc/cs2024.md index 237c8f0c0124c..41afd300147d6 100644 --- a/docs/csharp/misc/cs2024.md +++ b/docs/csharp/misc/cs2024.md @@ -21,7 +21,7 @@ Invalid file section alignment number '#' The following sample generates CS2024: -``` +```csharp // CS2024.cs // compile with: /filealign:ex // CS2024 expected diff --git a/docs/csharp/misc/cs2034.md b/docs/csharp/misc/cs2034.md index cbd66273107d6..178b84bd714c2 100644 --- a/docs/csharp/misc/cs2034.md +++ b/docs/csharp/misc/cs2034.md @@ -22,7 +22,7 @@ A /reference option that declares an extern alias can only have one filename. To ## Example The following code will generate error CS2034. -``` +```csharp // CS2034.cs // compile with: /r:A1=cs2034a1.dll;A2=cs2034a2.dll // to fix, compile with: /r:A1=cs2034a1.dll /r:A2=cs2034a2.dll diff --git a/docs/csharp/misc/cs2035.md b/docs/csharp/misc/cs2035.md index 35e5164f381d4..ae216886b9d25 100644 --- a/docs/csharp/misc/cs2035.md +++ b/docs/csharp/misc/cs2035.md @@ -22,7 +22,7 @@ Command-line syntax error: Missing ':\' for 'compiler_option' option ## Example The following sample generates CS2035. -``` +```csharp // CS2035.cs // compile with: /baseaddress // CS2035 expected diff --git a/docs/csharp/misc/cs2036.md b/docs/csharp/misc/cs2036.md index 9771e9cfb435e..dbc29b2ffde57 100644 --- a/docs/csharp/misc/cs2036.md +++ b/docs/csharp/misc/cs2036.md @@ -28,7 +28,7 @@ The /pdb option requires that the /debug option also be used. ## Example The following example generates CS2036 when it is compiled with the **/pdb** option but not the /debug option: -``` +```csharp // cs2036.cs // Compile with: /pdb // CS2036 diff --git a/docs/csharp/misc/cs3000.md b/docs/csharp/misc/cs3000.md index aa4ec5d3b5fc8..aefc676b1c57d 100644 --- a/docs/csharp/misc/cs3000.md +++ b/docs/csharp/misc/cs3000.md @@ -21,7 +21,7 @@ Methods with variable arguments are not CLS-compliant The following example generates the warning CS3000. -``` +```csharp // CS3000.cs // compile with: /target:library // CS3000 expected diff --git a/docs/csharp/misc/cs3001.md b/docs/csharp/misc/cs3001.md index 5b87b2c19d652..cbc9449afc1c0 100644 --- a/docs/csharp/misc/cs3001.md +++ b/docs/csharp/misc/cs3001.md @@ -22,7 +22,7 @@ Argument type 'type' is not CLS-compliant ## Example The following example generates CS3001: -``` +```csharp // CS3001.cs [assembly:System.CLSCompliant(true)] diff --git a/docs/csharp/misc/cs3002.md b/docs/csharp/misc/cs3002.md index ee4102755a620..92c0cc25f8858 100644 --- a/docs/csharp/misc/cs3002.md +++ b/docs/csharp/misc/cs3002.md @@ -22,7 +22,7 @@ Return type of 'method' is not CLS-compliant ## Example The following example generates CS3002: -``` +```csharp // CS3002.cs [assembly:System.CLSCompliant(true)] diff --git a/docs/csharp/misc/cs3005.md b/docs/csharp/misc/cs3005.md index 929db654a975c..fccba903d113d 100644 --- a/docs/csharp/misc/cs3005.md +++ b/docs/csharp/misc/cs3005.md @@ -22,7 +22,7 @@ Identifier 'identifier' differing only in case is not CLS-compliant ## Example The following example generates CS3003: -``` +```csharp // CS3005.cs using System; diff --git a/docs/csharp/misc/cs3006.md b/docs/csharp/misc/cs3006.md index 7e51720f0e7af..1a4f0784ddea0 100644 --- a/docs/csharp/misc/cs3006.md +++ b/docs/csharp/misc/cs3006.md @@ -22,7 +22,7 @@ Overloaded method 'method' differing only in ref or out, or in array rank, is no ## Example The following example generates CS3006. To resolve this warning, comment out the assembly-level attribute or remove one of the method definitions. -``` +```csharp // CS3006.cs using System; diff --git a/docs/csharp/misc/cs3008.md b/docs/csharp/misc/cs3008.md index 4c85b51eac31b..e8e84f49084c6 100644 --- a/docs/csharp/misc/cs3008.md +++ b/docs/csharp/misc/cs3008.md @@ -22,7 +22,7 @@ Identifier 'identifier' differing only in case is not CLS-compliant ## Example The following example generates CS3008: -``` +```csharp // CS3008.cs using System; diff --git a/docs/csharp/misc/cs3010.md b/docs/csharp/misc/cs3010.md index 2094424386262..6c3cfd801d994 100644 --- a/docs/csharp/misc/cs3010.md +++ b/docs/csharp/misc/cs3010.md @@ -22,7 +22,7 @@ ms.author: "wiwagn" ## Example The following example generates CS3010: -``` +```csharp // CS3010.cs using System; diff --git a/docs/csharp/misc/cs3011.md b/docs/csharp/misc/cs3011.md index 75c9ac6ddacb8..ebb00e463bc23 100644 --- a/docs/csharp/misc/cs3011.md +++ b/docs/csharp/misc/cs3011.md @@ -22,7 +22,7 @@ ms.author: "wiwagn" ## Example The following example generates CS3011: -``` +```csharp // CS3011.cs using System; diff --git a/docs/csharp/misc/cs3012.md b/docs/csharp/misc/cs3012.md index cc29e34603214..55225db2048e0 100644 --- a/docs/csharp/misc/cs3012.md +++ b/docs/csharp/misc/cs3012.md @@ -22,7 +22,7 @@ You cannot specify the CLSCompliant attribute on a module that differs from the ## Example The following example, when built without `/target:module`, generates CS3012: -``` +```csharp // CS3012.cs // compile with: /W:1 diff --git a/docs/csharp/misc/cs3014.md b/docs/csharp/misc/cs3014.md index 0d6c3a123bc19..cba1e212b646f 100644 --- a/docs/csharp/misc/cs3014.md +++ b/docs/csharp/misc/cs3014.md @@ -22,7 +22,7 @@ ms.author: "wiwagn" ## Example The following example generates CS3014: -``` +```csharp // CS3014.cs using System; diff --git a/docs/csharp/misc/cs3015.md b/docs/csharp/misc/cs3015.md index 025d8ff1be2e0..821580c73dc39 100644 --- a/docs/csharp/misc/cs3015.md +++ b/docs/csharp/misc/cs3015.md @@ -22,7 +22,7 @@ ms.author: "wiwagn" ## Example The following sample generates C3015. -``` +```csharp // CS3015.cs // compile with: /target:library using System; diff --git a/docs/csharp/misc/cs3016.md b/docs/csharp/misc/cs3016.md index efda2178d0d48..8daf24d35baef 100644 --- a/docs/csharp/misc/cs3016.md +++ b/docs/csharp/misc/cs3016.md @@ -22,7 +22,7 @@ Arrays as attribute arguments is not CLS-compliant ## Example The following example generates CS3016: -``` +```csharp // CS3016.cs using System; diff --git a/docs/csharp/misc/cs3017.md b/docs/csharp/misc/cs3017.md index ec144e1f6c7f7..1006e38e41f32 100644 --- a/docs/csharp/misc/cs3017.md +++ b/docs/csharp/misc/cs3017.md @@ -22,7 +22,7 @@ You cannot specify the CLSCompliant attribute on a module that differs from the ## Example The following example generates CS3017: -``` +```csharp // CS3017.cs // compile with: /target:module diff --git a/docs/csharp/misc/cs3018.md b/docs/csharp/misc/cs3018.md index 270f0559323cb..e2d2f2b536272 100644 --- a/docs/csharp/misc/cs3018.md +++ b/docs/csharp/misc/cs3018.md @@ -22,7 +22,7 @@ ms.author: "wiwagn" ## Example The following sample generates CS3018. -``` +```csharp // CS3018.cs // compile with: /target:library using System; diff --git a/docs/csharp/misc/cs3019.md b/docs/csharp/misc/cs3019.md index 94f455828d201..bcd744aca2e6f 100644 --- a/docs/csharp/misc/cs3019.md +++ b/docs/csharp/misc/cs3019.md @@ -22,7 +22,7 @@ CLS compliance checking will not be performed on 'type' because it is not visibl ## Example The following sample generates CS3019: -``` +```csharp // CS3019.cs // compile with: /W:2 diff --git a/docs/csharp/misc/cs3021.md b/docs/csharp/misc/cs3021.md index cfa9a1aacf9d8..4a7edbb53c35b 100644 --- a/docs/csharp/misc/cs3021.md +++ b/docs/csharp/misc/cs3021.md @@ -24,7 +24,7 @@ ms.author: "wiwagn" ## Example The following example generates CS3021: -``` +```csharp // CS3021.cs using System; // Uncomment the following line to declare the assembly CLS Compliant, diff --git a/docs/csharp/misc/cs3022.md b/docs/csharp/misc/cs3022.md index 9e5f0cb9124ed..37b7259089ba1 100644 --- a/docs/csharp/misc/cs3022.md +++ b/docs/csharp/misc/cs3022.md @@ -22,7 +22,7 @@ CLSCompliant attribute has no meaning when applied to parameters. Try putting it ## Example The following sample generates CS3022: -``` +```csharp // CS3022.cs // compile with: /W:1 diff --git a/docs/csharp/misc/cs3023.md b/docs/csharp/misc/cs3023.md index 6acb0ea3d9f7d..6dc351daae832 100644 --- a/docs/csharp/misc/cs3023.md +++ b/docs/csharp/misc/cs3023.md @@ -22,7 +22,7 @@ CLSCompliant attribute has no meaning when applied to return types. Try putting ## Example The following example generates warning CS3023: -``` +```csharp // C3023.cs [assembly:System.CLSCompliant(true)] diff --git a/docs/csharp/misc/cs3026.md b/docs/csharp/misc/cs3026.md index e19c07016b7f8..7d56137133d22 100644 --- a/docs/csharp/misc/cs3026.md +++ b/docs/csharp/misc/cs3026.md @@ -22,7 +22,7 @@ CLS-compliant field 'field' cannot be volatile ## Example The following example generates CS3026. -``` +```csharp // CS3026.cs [assembly:System.CLSCompliant(true)] public class Test diff --git a/docs/csharp/misc/cs3027.md b/docs/csharp/misc/cs3027.md index 08b36d8752924..e2e870dad45d5 100644 --- a/docs/csharp/misc/cs3027.md +++ b/docs/csharp/misc/cs3027.md @@ -22,7 +22,7 @@ ms.author: "wiwagn" ## Example The following sample contains an interface with a method that uses a non-CLS compliant type in its signature, making the type non-CLS compliant. -``` +```csharp // CS3027.cs // compile with: /target:library public interface IBase @@ -34,7 +34,7 @@ public interface IBase ## Example The following sample generates CS3027. -``` +```csharp // CS3027_b.cs // compile with: /reference:CS3027.dll /target:library /W:1 [assembly:System.CLSCompliant(true)] diff --git a/docs/csharp/misc/cs5001.md b/docs/csharp/misc/cs5001.md index 8cdfc14f5e2ab..0ba57ea4c453c 100644 --- a/docs/csharp/misc/cs5001.md +++ b/docs/csharp/misc/cs5001.md @@ -24,7 +24,7 @@ Program 'program' does not contain a static 'Main' method suitable for an entry ## Example The following example generates CS5001: -``` +```csharp // CS5001.cs // CS5001 expected public class a