diff --git a/csharp/roslyn-sdk/SemanticQuickStart/SemanticQuickStart.csproj b/csharp/roslyn-sdk/SemanticQuickStart/SemanticQuickStart.csproj index 444a079d3a9..f5b9691869b 100644 --- a/csharp/roslyn-sdk/SemanticQuickStart/SemanticQuickStart.csproj +++ b/csharp/roslyn-sdk/SemanticQuickStart/SemanticQuickStart.csproj @@ -2,13 +2,11 @@ Exe - net461 + netcoreapp3.0 - - - + diff --git a/csharp/roslyn-sdk/SemanticQuickStart/SemanticQuickStart.sln b/csharp/roslyn-sdk/SemanticQuickStart/SemanticQuickStart.sln deleted file mode 100644 index 5fa2b456031..00000000000 --- a/csharp/roslyn-sdk/SemanticQuickStart/SemanticQuickStart.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.2027 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SemanticQuickStart", "SemanticQuickStart.csproj", "{107FCAE6-875A-4C7A-97FF-DCDD4EA14057}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {107FCAE6-875A-4C7A-97FF-DCDD4EA14057}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {107FCAE6-875A-4C7A-97FF-DCDD4EA14057}.Debug|Any CPU.Build.0 = Debug|Any CPU - {107FCAE6-875A-4C7A-97FF-DCDD4EA14057}.Release|Any CPU.ActiveCfg = Release|Any CPU - {107FCAE6-875A-4C7A-97FF-DCDD4EA14057}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {7EE79446-FEFE-4B71-8379-FDD1B7C6053B} - EndGlobalSection -EndGlobal diff --git a/csharp/roslyn-sdk/SyntaxQuickStart/HelloSyntaxTree/HelloSyntaxTree.csproj b/csharp/roslyn-sdk/SyntaxQuickStart/HelloSyntaxTree/HelloSyntaxTree.csproj index 444a079d3a9..f5b9691869b 100644 --- a/csharp/roslyn-sdk/SyntaxQuickStart/HelloSyntaxTree/HelloSyntaxTree.csproj +++ b/csharp/roslyn-sdk/SyntaxQuickStart/HelloSyntaxTree/HelloSyntaxTree.csproj @@ -2,13 +2,11 @@ Exe - net461 + netcoreapp3.0 - - - + diff --git a/csharp/roslyn-sdk/SyntaxQuickStart/SyntaxQuickStart.sln b/csharp/roslyn-sdk/SyntaxQuickStart/SyntaxQuickStart.sln index 1f5b29c5639..29b506fc1eb 100644 --- a/csharp/roslyn-sdk/SyntaxQuickStart/SyntaxQuickStart.sln +++ b/csharp/roslyn-sdk/SyntaxQuickStart/SyntaxQuickStart.sln @@ -1,31 +1,48 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.27130.2027 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloSyntaxTree", "HelloSyntaxTree\HelloSyntaxTree.csproj", "{3B81640F-7C63-4AF4-8C17-5854E69E1648}" +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloSyntaxTree", "HelloSyntaxTree\HelloSyntaxTree.csproj", "{489614F6-9996-4451-B545-E083479360A6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SyntaxWalker", "SyntaxWalker\SyntaxWalker.csproj", "{F89C8D27-7CAC-4ECD-B1E5-51434178DBB9}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SyntaxWalker", "SyntaxWalker\SyntaxWalker.csproj", "{40846331-F548-46B1-BEEE-01872169FED2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3B81640F-7C63-4AF4-8C17-5854E69E1648}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3B81640F-7C63-4AF4-8C17-5854E69E1648}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3B81640F-7C63-4AF4-8C17-5854E69E1648}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3B81640F-7C63-4AF4-8C17-5854E69E1648}.Release|Any CPU.Build.0 = Release|Any CPU - {F89C8D27-7CAC-4ECD-B1E5-51434178DBB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F89C8D27-7CAC-4ECD-B1E5-51434178DBB9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F89C8D27-7CAC-4ECD-B1E5-51434178DBB9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F89C8D27-7CAC-4ECD-B1E5-51434178DBB9}.Release|Any CPU.Build.0 = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {4A48FB51-2442-4F43-8783-F314498EFDA0} + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {489614F6-9996-4451-B545-E083479360A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {489614F6-9996-4451-B545-E083479360A6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {489614F6-9996-4451-B545-E083479360A6}.Debug|x64.ActiveCfg = Debug|Any CPU + {489614F6-9996-4451-B545-E083479360A6}.Debug|x64.Build.0 = Debug|Any CPU + {489614F6-9996-4451-B545-E083479360A6}.Debug|x86.ActiveCfg = Debug|Any CPU + {489614F6-9996-4451-B545-E083479360A6}.Debug|x86.Build.0 = Debug|Any CPU + {489614F6-9996-4451-B545-E083479360A6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {489614F6-9996-4451-B545-E083479360A6}.Release|Any CPU.Build.0 = Release|Any CPU + {489614F6-9996-4451-B545-E083479360A6}.Release|x64.ActiveCfg = Release|Any CPU + {489614F6-9996-4451-B545-E083479360A6}.Release|x64.Build.0 = Release|Any CPU + {489614F6-9996-4451-B545-E083479360A6}.Release|x86.ActiveCfg = Release|Any CPU + {489614F6-9996-4451-B545-E083479360A6}.Release|x86.Build.0 = Release|Any CPU + {40846331-F548-46B1-BEEE-01872169FED2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {40846331-F548-46B1-BEEE-01872169FED2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {40846331-F548-46B1-BEEE-01872169FED2}.Debug|x64.ActiveCfg = Debug|Any CPU + {40846331-F548-46B1-BEEE-01872169FED2}.Debug|x64.Build.0 = Debug|Any CPU + {40846331-F548-46B1-BEEE-01872169FED2}.Debug|x86.ActiveCfg = Debug|Any CPU + {40846331-F548-46B1-BEEE-01872169FED2}.Debug|x86.Build.0 = Debug|Any CPU + {40846331-F548-46B1-BEEE-01872169FED2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {40846331-F548-46B1-BEEE-01872169FED2}.Release|Any CPU.Build.0 = Release|Any CPU + {40846331-F548-46B1-BEEE-01872169FED2}.Release|x64.ActiveCfg = Release|Any CPU + {40846331-F548-46B1-BEEE-01872169FED2}.Release|x64.Build.0 = Release|Any CPU + {40846331-F548-46B1-BEEE-01872169FED2}.Release|x86.ActiveCfg = Release|Any CPU + {40846331-F548-46B1-BEEE-01872169FED2}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/csharp/roslyn-sdk/SyntaxQuickStart/SyntaxWalker/SyntaxWalker.csproj b/csharp/roslyn-sdk/SyntaxQuickStart/SyntaxWalker/SyntaxWalker.csproj index 444a079d3a9..f5b9691869b 100644 --- a/csharp/roslyn-sdk/SyntaxQuickStart/SyntaxWalker/SyntaxWalker.csproj +++ b/csharp/roslyn-sdk/SyntaxQuickStart/SyntaxWalker/SyntaxWalker.csproj @@ -2,13 +2,11 @@ Exe - net461 + netcoreapp3.0 - - - + diff --git a/csharp/roslyn-sdk/SyntaxTransformationQuickStart/ConstructionCS/ConstructionCS.csproj b/csharp/roslyn-sdk/SyntaxTransformationQuickStart/ConstructionCS/ConstructionCS.csproj index 444a079d3a9..27596d2d68c 100644 --- a/csharp/roslyn-sdk/SyntaxTransformationQuickStart/ConstructionCS/ConstructionCS.csproj +++ b/csharp/roslyn-sdk/SyntaxTransformationQuickStart/ConstructionCS/ConstructionCS.csproj @@ -2,13 +2,11 @@ Exe - net461 + netcoreapp3.0 - - - + diff --git a/csharp/roslyn-sdk/SyntaxTransformationQuickStart/ConstructionCS/Program.cs b/csharp/roslyn-sdk/SyntaxTransformationQuickStart/ConstructionCS/Program.cs index bb1158bf8c4..6d64ba13cf7 100644 --- a/csharp/roslyn-sdk/SyntaxTransformationQuickStart/ConstructionCS/Program.cs +++ b/csharp/roslyn-sdk/SyntaxTransformationQuickStart/ConstructionCS/Program.cs @@ -2,7 +2,6 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.CodeAnalysis.MSBuild; // using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; @@ -34,8 +33,6 @@ static void Main(string[] args) static void Main(string[] args) { - var workspace = MSBuildWorkspace.Create(); - // NameSyntax name = IdentifierName("System"); WriteLine($"\tCreated the identifier {name.ToString()}"); diff --git a/csharp/roslyn-sdk/SyntaxTransformationQuickStart/SyntaxTransformationQuickStart.sln b/csharp/roslyn-sdk/SyntaxTransformationQuickStart/SyntaxTransformationQuickStart.sln index dfcdebeb6f2..3aad2377e5b 100644 --- a/csharp/roslyn-sdk/SyntaxTransformationQuickStart/SyntaxTransformationQuickStart.sln +++ b/csharp/roslyn-sdk/SyntaxTransformationQuickStart/SyntaxTransformationQuickStart.sln @@ -1,31 +1,48 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.27729.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConstructionCS", "ConstructionCS\ConstructionCS.csproj", "{6664C501-ACEC-4501-A5D3-D560330EB028}" +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConstructionCS", "ConstructionCS\ConstructionCS.csproj", "{A9BDD3DB-BD15-45B1-9290-9CA0896A3371}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TransformationCS", "TransformationCS\TransformationCS.csproj", "{A52FC7BE-F712-4615-95E6-A8F4C723AA0D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TransformationCS", "TransformationCS\TransformationCS.csproj", "{09A38DCC-6AC5-4CCE-8B38-CCE2FB281F7C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6664C501-ACEC-4501-A5D3-D560330EB028}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6664C501-ACEC-4501-A5D3-D560330EB028}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6664C501-ACEC-4501-A5D3-D560330EB028}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6664C501-ACEC-4501-A5D3-D560330EB028}.Release|Any CPU.Build.0 = Release|Any CPU - {A52FC7BE-F712-4615-95E6-A8F4C723AA0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A52FC7BE-F712-4615-95E6-A8F4C723AA0D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A52FC7BE-F712-4615-95E6-A8F4C723AA0D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A52FC7BE-F712-4615-95E6-A8F4C723AA0D}.Release|Any CPU.Build.0 = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {7D99F54E-A42E-429C-9445-22F93EC83D21} + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A9BDD3DB-BD15-45B1-9290-9CA0896A3371}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A9BDD3DB-BD15-45B1-9290-9CA0896A3371}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A9BDD3DB-BD15-45B1-9290-9CA0896A3371}.Debug|x64.ActiveCfg = Debug|Any CPU + {A9BDD3DB-BD15-45B1-9290-9CA0896A3371}.Debug|x64.Build.0 = Debug|Any CPU + {A9BDD3DB-BD15-45B1-9290-9CA0896A3371}.Debug|x86.ActiveCfg = Debug|Any CPU + {A9BDD3DB-BD15-45B1-9290-9CA0896A3371}.Debug|x86.Build.0 = Debug|Any CPU + {A9BDD3DB-BD15-45B1-9290-9CA0896A3371}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A9BDD3DB-BD15-45B1-9290-9CA0896A3371}.Release|Any CPU.Build.0 = Release|Any CPU + {A9BDD3DB-BD15-45B1-9290-9CA0896A3371}.Release|x64.ActiveCfg = Release|Any CPU + {A9BDD3DB-BD15-45B1-9290-9CA0896A3371}.Release|x64.Build.0 = Release|Any CPU + {A9BDD3DB-BD15-45B1-9290-9CA0896A3371}.Release|x86.ActiveCfg = Release|Any CPU + {A9BDD3DB-BD15-45B1-9290-9CA0896A3371}.Release|x86.Build.0 = Release|Any CPU + {09A38DCC-6AC5-4CCE-8B38-CCE2FB281F7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {09A38DCC-6AC5-4CCE-8B38-CCE2FB281F7C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {09A38DCC-6AC5-4CCE-8B38-CCE2FB281F7C}.Debug|x64.ActiveCfg = Debug|Any CPU + {09A38DCC-6AC5-4CCE-8B38-CCE2FB281F7C}.Debug|x64.Build.0 = Debug|Any CPU + {09A38DCC-6AC5-4CCE-8B38-CCE2FB281F7C}.Debug|x86.ActiveCfg = Debug|Any CPU + {09A38DCC-6AC5-4CCE-8B38-CCE2FB281F7C}.Debug|x86.Build.0 = Debug|Any CPU + {09A38DCC-6AC5-4CCE-8B38-CCE2FB281F7C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {09A38DCC-6AC5-4CCE-8B38-CCE2FB281F7C}.Release|Any CPU.Build.0 = Release|Any CPU + {09A38DCC-6AC5-4CCE-8B38-CCE2FB281F7C}.Release|x64.ActiveCfg = Release|Any CPU + {09A38DCC-6AC5-4CCE-8B38-CCE2FB281F7C}.Release|x64.Build.0 = Release|Any CPU + {09A38DCC-6AC5-4CCE-8B38-CCE2FB281F7C}.Release|x86.ActiveCfg = Release|Any CPU + {09A38DCC-6AC5-4CCE-8B38-CCE2FB281F7C}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/csharp/roslyn-sdk/SyntaxTransformationQuickStart/TransformationCS/TransformationCS.csproj b/csharp/roslyn-sdk/SyntaxTransformationQuickStart/TransformationCS/TransformationCS.csproj index 444a079d3a9..f5b9691869b 100644 --- a/csharp/roslyn-sdk/SyntaxTransformationQuickStart/TransformationCS/TransformationCS.csproj +++ b/csharp/roslyn-sdk/SyntaxTransformationQuickStart/TransformationCS/TransformationCS.csproj @@ -2,13 +2,11 @@ Exe - net461 + netcoreapp3.0 - - - + diff --git a/csharp/tutorials/nullable-reference-migration/start/SimpleFeedReader.sln b/csharp/tutorials/nullable-reference-migration/start/SimpleFeedReader.sln index c87a7c4a9b8..c843a424174 100644 --- a/csharp/tutorials/nullable-reference-migration/start/SimpleFeedReader.sln +++ b/csharp/tutorials/nullable-reference-migration/start/SimpleFeedReader.sln @@ -1,31 +1,48 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.27428.2037 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleFeedReader", "SimpleFeedReader\SimpleFeedReader.csproj", "{9396044C-E61F-4CC2-9805-F859FF4640F6}" +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleFeedReader", "SimpleFeedReader\SimpleFeedReader.csproj", "{1CD4D578-9B30-498C-85B6-1A6AE689E157}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleFeedReader.Tests", "SimpleFeedReader.Tests\SimpleFeedReader.Tests.csproj", "{18167449-DCC4-4D2E-BCCB-30AA40098C05}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleFeedReader.Tests", "SimpleFeedReader.Tests\SimpleFeedReader.Tests.csproj", "{4D17B171-9545-47D0-AFA9-B2689AA4EF9B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9396044C-E61F-4CC2-9805-F859FF4640F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9396044C-E61F-4CC2-9805-F859FF4640F6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9396044C-E61F-4CC2-9805-F859FF4640F6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9396044C-E61F-4CC2-9805-F859FF4640F6}.Release|Any CPU.Build.0 = Release|Any CPU - {18167449-DCC4-4D2E-BCCB-30AA40098C05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {18167449-DCC4-4D2E-BCCB-30AA40098C05}.Debug|Any CPU.Build.0 = Debug|Any CPU - {18167449-DCC4-4D2E-BCCB-30AA40098C05}.Release|Any CPU.ActiveCfg = Release|Any CPU - {18167449-DCC4-4D2E-BCCB-30AA40098C05}.Release|Any CPU.Build.0 = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {CDD224D8-92AA-4166-8399-8D19B6BFF3CD} + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1CD4D578-9B30-498C-85B6-1A6AE689E157}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1CD4D578-9B30-498C-85B6-1A6AE689E157}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1CD4D578-9B30-498C-85B6-1A6AE689E157}.Debug|x64.ActiveCfg = Debug|Any CPU + {1CD4D578-9B30-498C-85B6-1A6AE689E157}.Debug|x64.Build.0 = Debug|Any CPU + {1CD4D578-9B30-498C-85B6-1A6AE689E157}.Debug|x86.ActiveCfg = Debug|Any CPU + {1CD4D578-9B30-498C-85B6-1A6AE689E157}.Debug|x86.Build.0 = Debug|Any CPU + {1CD4D578-9B30-498C-85B6-1A6AE689E157}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1CD4D578-9B30-498C-85B6-1A6AE689E157}.Release|Any CPU.Build.0 = Release|Any CPU + {1CD4D578-9B30-498C-85B6-1A6AE689E157}.Release|x64.ActiveCfg = Release|Any CPU + {1CD4D578-9B30-498C-85B6-1A6AE689E157}.Release|x64.Build.0 = Release|Any CPU + {1CD4D578-9B30-498C-85B6-1A6AE689E157}.Release|x86.ActiveCfg = Release|Any CPU + {1CD4D578-9B30-498C-85B6-1A6AE689E157}.Release|x86.Build.0 = Release|Any CPU + {4D17B171-9545-47D0-AFA9-B2689AA4EF9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4D17B171-9545-47D0-AFA9-B2689AA4EF9B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4D17B171-9545-47D0-AFA9-B2689AA4EF9B}.Debug|x64.ActiveCfg = Debug|Any CPU + {4D17B171-9545-47D0-AFA9-B2689AA4EF9B}.Debug|x64.Build.0 = Debug|Any CPU + {4D17B171-9545-47D0-AFA9-B2689AA4EF9B}.Debug|x86.ActiveCfg = Debug|Any CPU + {4D17B171-9545-47D0-AFA9-B2689AA4EF9B}.Debug|x86.Build.0 = Debug|Any CPU + {4D17B171-9545-47D0-AFA9-B2689AA4EF9B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4D17B171-9545-47D0-AFA9-B2689AA4EF9B}.Release|Any CPU.Build.0 = Release|Any CPU + {4D17B171-9545-47D0-AFA9-B2689AA4EF9B}.Release|x64.ActiveCfg = Release|Any CPU + {4D17B171-9545-47D0-AFA9-B2689AA4EF9B}.Release|x64.Build.0 = Release|Any CPU + {4D17B171-9545-47D0-AFA9-B2689AA4EF9B}.Release|x86.ActiveCfg = Release|Any CPU + {4D17B171-9545-47D0-AFA9-B2689AA4EF9B}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/snippets/cpp/VS_Snippets_CLR/LayoutKind/CPP/layoutkind.cpp b/snippets/cpp/VS_Snippets_CLR/LayoutKind/CPP/layoutkind.cpp index 07e0b390435..0763df330bd 100644 --- a/snippets/cpp/VS_Snippets_CLR/LayoutKind/CPP/layoutkind.cpp +++ b/snippets/cpp/VS_Snippets_CLR/LayoutKind/CPP/layoutkind.cpp @@ -38,7 +38,7 @@ value struct Rect int bottom; }; -ref class LibWrapper +ref class NativeMethods { public: @@ -59,7 +59,7 @@ int main() Point myPoint = Point( ); myPoint.x = 50; myPoint.y = 50; - bPointInRect = LibWrapper::PtInRect( &myRect, myPoint ); + bPointInRect = NativeMethods::PtInRect( &myRect, myPoint ); if ( bPointInRect == Bool::True ) Console::WriteLine( "Point lies within the Rect" ); else diff --git a/snippets/cpp/VS_Snippets_CLR/StructLayoutAttribute/CPP/structlayoutattribute.cpp b/snippets/cpp/VS_Snippets_CLR/StructLayoutAttribute/CPP/structlayoutattribute.cpp index 5251574558d..4c5c693094c 100644 --- a/snippets/cpp/VS_Snippets_CLR/StructLayoutAttribute/CPP/structlayoutattribute.cpp +++ b/snippets/cpp/VS_Snippets_CLR/StructLayoutAttribute/CPP/structlayoutattribute.cpp @@ -46,7 +46,7 @@ value class MySystemTime short wMilliseconds; }; -ref class LibWrapper +ref class NativeMethods { public: @@ -59,7 +59,7 @@ int main() try { MySystemTime sysTime; - LibWrapper::GetSystemTime( &sysTime ); + NativeMethods::GetSystemTime( &sysTime ); Console::WriteLine( "The System time is {0}/{1}/{2} {3}:{4}:{5}", sysTime.wDay, sysTime.wMonth, sysTime.wYear, sysTime.wHour, sysTime.wMinute, sysTime.wSecond ); } catch ( TypeLoadException^ e ) diff --git a/snippets/csharp/VS_Snippets_CLR/LayoutKind/CS/layoutkind.cs b/snippets/csharp/VS_Snippets_CLR/LayoutKind/CS/layoutkind.cs index 22119935680..2543cbe3016 100644 --- a/snippets/csharp/VS_Snippets_CLR/LayoutKind/CS/layoutkind.cs +++ b/snippets/csharp/VS_Snippets_CLR/LayoutKind/CS/layoutkind.cs @@ -34,10 +34,10 @@ public struct Rect [FieldOffset(12)] public int bottom; } - class LibWrapper + internal static class NativeMethods { [DllImport("user32.dll", CallingConvention=CallingConvention.StdCall)] - public static extern Bool PtInRect(ref Rect r, Point p); + internal static extern Bool PtInRect(ref Rect r, Point p); }; class TestApplication @@ -55,7 +55,7 @@ public static void Main() Point myPoint = new Point(); myPoint.x = 50; myPoint.y = 50; - bPointInRect = LibWrapper.PtInRect(ref myRect, myPoint); + bPointInRect = NativeMethods.PtInRect(ref myRect, myPoint); if(bPointInRect == Bool.True) Console.WriteLine("Point lies within the Rect"); else diff --git a/snippets/csharp/VS_Snippets_CLR/StructLayoutAttribute/CS/structlayoutattribute.cs b/snippets/csharp/VS_Snippets_CLR/StructLayoutAttribute/CS/structlayoutattribute.cs index 4dbb5d90a75..cf7c156539e 100644 --- a/snippets/csharp/VS_Snippets_CLR/StructLayoutAttribute/CS/structlayoutattribute.cs +++ b/snippets/csharp/VS_Snippets_CLR/StructLayoutAttribute/CS/structlayoutattribute.cs @@ -30,10 +30,10 @@ public class MySystemTime [FieldOffset(14)]public ushort wMilliseconds; } - class LibWrapper + internal static class NativeMethods { [DllImport("kernel32.dll")] - public static extern void GetSystemTime([MarshalAs(UnmanagedType.LPStruct)]MySystemTime st); + internal static extern void GetSystemTime([MarshalAs(UnmanagedType.LPStruct)]MySystemTime st); }; class TestApplication @@ -43,7 +43,7 @@ public static void Main() try { MySystemTime sysTime = new MySystemTime(); - LibWrapper.GetSystemTime(sysTime); + NativeMethods.GetSystemTime(sysTime); Console.WriteLine("The System time is {0}/{1}/{2} {3}:{4}:{5}", sysTime.wDay, sysTime.wMonth, sysTime.wYear, sysTime.wHour, sysTime.wMinute, sysTime.wSecond); } diff --git a/snippets/csharp/VS_Snippets_CLR_System/system.aggregateexception.class/cs/exception1.cs b/snippets/csharp/VS_Snippets_CLR_System/system.aggregateexception.class/cs/exception1.cs index dac8a675612..ea77d3d533e 100644 --- a/snippets/csharp/VS_Snippets_CLR_System/system.aggregateexception.class/cs/exception1.cs +++ b/snippets/csharp/VS_Snippets_CLR_System/system.aggregateexception.class/cs/exception1.cs @@ -17,10 +17,17 @@ static async Task Main(string[] args) // Use this line to throw an exception that is not handled. // Task task1 = Task.Factory.StartNew(() => { throw new IndexOutOfRangeException(); } ); - try { + try + { await task1; } - catch (AggregateException ae) { + catch (UnauthorizedAccessException ae) + { + Console.WriteLine("Caught unauthorized access exception-await behavior"); + } + catch (AggregateException ae) + { + Console.WriteLine("Caught aggregate exception-Task.Wait behavior"); ae.Handle((x) => { if (x is UnauthorizedAccessException) // This we know how to handle. diff --git a/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.HtmlWindow/CS/Form1.cs b/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.HtmlWindow/CS/Form1.cs index 233fd55ab1f..722b0fdb2de 100644 --- a/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.HtmlWindow/CS/Form1.cs +++ b/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.HtmlWindow/CS/Form1.cs @@ -305,17 +305,17 @@ private void suppressScriptErrorButton_Click(object sender, EventArgs e) // private void SuppressScriptErrors() { - if (webBrowser1.Document != null) - { + if (webBrowser1.Document != null) + { webBrowser1.Document.Window.Error += new HtmlElementErrorEventHandler(scriptWindow_Error); - } - } + } + } - private void scriptWindow_Error(object sender, HtmlElementErrorEventArgs e) - { - MessageBox.Show("Suppressed error!"); - e.Handled = true; - } + private void scriptWindow_Error(object sender, HtmlElementErrorEventArgs e) + { + MessageBox.Show("Suppressed error!"); + e.Handled = true; + } // // @@ -341,4 +341,4 @@ private void button1_Click(object sender, EventArgs e) } // } -} \ No newline at end of file +} diff --git a/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.RectangleToScreen/CS/form1.cs b/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.RectangleToScreen/CS/form1.cs index d56270590ae..2ce60a9386a 100644 --- a/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.RectangleToScreen/CS/form1.cs +++ b/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.RectangleToScreen/CS/form1.cs @@ -1,15 +1,7 @@ -// This example demonstrates using the following members: -// Form.BackColor, Control.RectangleToScreen, Control.PointToScreen, -// ControlPaint.DrawReversibleFrame, and Rectangle.Intersects. - - using System.Windows.Forms; using System.Drawing; -public class Form1: - System.Windows.Forms.Form - - +public class Form1: Form { public Form1() : base() { @@ -87,8 +79,7 @@ private void Button1_Click(System.Object sender, System.EventArgs e) // control's color will change. bool isDrag = false; - Rectangle theRectangle = new Rectangle - (new Point(0, 0), new Size(0, 0)); + Rectangle theRectangle = new Rectangle(new Point(0, 0), new Size(0, 0)); Point startPoint; private void Form1_MouseDown(object sender, @@ -97,7 +88,7 @@ private void Form1_MouseDown(object sender, // Set the isDrag variable to true and get the starting point // by using the PointToScreen method to convert form - // coordinates to screen coordinates. + // coordinates to screen coordinates. if (e.Button==MouseButtons.Left) { isDrag = true; @@ -115,17 +106,17 @@ private void Form1_MouseMove(object sender, { // If the mouse is being dragged, - // undraw and redraw the rectangle as the mouse moves. + // undraw and redraw the rectangle as the mouse moves. if (isDrag) // Hide the previous rectangle by calling the - // DrawReversibleFrame method with the same parameters. + // DrawReversibleFrame method with the same parameters. { ControlPaint.DrawReversibleFrame(theRectangle, this.BackColor, FrameStyle.Dashed); // Calculate the endpoint and dimensions for the new - // rectangle, again using the PointToScreen method. + // rectangle, again using the PointToScreen method. Point endPoint = ((Control) sender).PointToScreen(new Point(e.X, e.Y)); int width = endPoint.X-startPoint.X; @@ -134,29 +125,28 @@ private void Form1_MouseMove(object sender, startPoint.Y, width, height); // Draw the new rectangle by calling DrawReversibleFrame - // again. + // again. ControlPaint.DrawReversibleFrame(theRectangle, this.BackColor, FrameStyle.Dashed); } } private void Form1_MouseUp(object sender, - System.Windows.Forms.MouseEventArgs e) + System.Windows.Forms.MouseEventArgs e) { - // If the MouseUp event occurs, the user is not dragging. isDrag = false; // Draw the rectangle to be evaluated. Set a dashed frame style // using the FrameStyle enumeration. ControlPaint.DrawReversibleFrame(theRectangle, - this.BackColor, FrameStyle.Dashed); + this.BackColor, FrameStyle.Dashed); // Find out which controls intersect the rectangle and // change their color. The method uses the RectangleToScreen // method to convert the Control's client coordinates // to screen coordinates. - Rectangle controlRectangle; + Rectangle controlRectangle; for(int i = 0; i < Controls.Count; i++) { controlRectangle = Controls[i].RectangleToScreen diff --git a/snippets/csharp/VS_Snippets_Wpf/datagrid_rowheader/csharp/datagrid_rowheader/window1.xaml.cs b/snippets/csharp/VS_Snippets_Wpf/datagrid_rowheader/csharp/datagrid_rowheader/window1.xaml.cs index 64c47c754ba..9ae29498a96 100644 --- a/snippets/csharp/VS_Snippets_Wpf/datagrid_rowheader/csharp/datagrid_rowheader/window1.xaml.cs +++ b/snippets/csharp/VS_Snippets_Wpf/datagrid_rowheader/csharp/datagrid_rowheader/window1.xaml.cs @@ -53,13 +53,11 @@ public object Convert(object value, Type targetType, object parameter, System.Gl { try { - //Get the DataRowView that is being passed to the Converter - System.Data.DataRowView drv = (System.Data.DataRowView)value; //Get the CollectionView from the DataGrid that is using the converter DataGrid dg = (DataGrid)Application.Current.MainWindow.FindName("DG1"); CollectionView cv = (CollectionView)dg.Items; - //Get the index of the DataRowView from the CollectionView - int rowindex = cv.IndexOf(drv)+1; + //Get the index of the item from the CollectionView + int rowindex = cv.IndexOf(value)+1; return rowindex.ToString(); } diff --git a/snippets/visualbasic/VS_Snippets_CLR/LayoutKind/VB/layoutkind.vb b/snippets/visualbasic/VS_Snippets_CLR/LayoutKind/VB/layoutkind.vb index 6695d3935d8..efea984deaa 100644 --- a/snippets/visualbasic/VS_Snippets_CLR/LayoutKind/VB/layoutkind.vb +++ b/snippets/visualbasic/VS_Snippets_CLR/LayoutKind/VB/layoutkind.vb @@ -24,12 +24,12 @@ Imports System.Runtime.InteropServices End Structure - Class LibWrapper + Friend Class NativeMethods _ - Public Shared Function PtInRect(ByRef r As Rect, p As Point) As Bool + Friend Shared Function PtInRect(ByRef r As Rect, p As Point) As Bool End Function - End Class 'LibWrapper + End Class 'NativeMethods Class TestApplication @@ -45,7 +45,7 @@ Imports System.Runtime.InteropServices Dim myPoint As New Point() myPoint.x = 50 myPoint.y = 50 - bPointInRect = LibWrapper.PtInRect(myRect, myPoint) + bPointInRect = NativeMethods.PtInRect(myRect, myPoint) If bPointInRect = Bool.True Then Console.WriteLine("Point lies within the Rect") Else diff --git a/snippets/visualbasic/VS_Snippets_CLR/StructLayoutAttribute/VB/structlayoutattribute.vb b/snippets/visualbasic/VS_Snippets_CLR/StructLayoutAttribute/VB/structlayoutattribute.vb index 7574875a300..1df2ecd1aaa 100644 --- a/snippets/visualbasic/VS_Snippets_CLR/StructLayoutAttribute/VB/structlayoutattribute.vb +++ b/snippets/visualbasic/VS_Snippets_CLR/StructLayoutAttribute/VB/structlayoutattribute.vb @@ -27,19 +27,19 @@ Namespace InteropSample End Class 'MySystemTime - Class LibWrapper + Friend Class NativeMethods _ - Public Shared Sub GetSystemTime( ByVal st As MySystemTime) + Friend Shared Sub GetSystemTime( ByVal st As MySystemTime) End Sub - End Class 'LibWrapper + End Class 'NativeMethods Class TestApplication Public Shared Sub Main() Try Dim sysTime As New MySystemTime() - LibWrapper.GetSystemTime(sysTime) + NativeMethods.GetSystemTime(sysTime) Console.WriteLine("The System time is {0}/{1}/{2} {3}:{4}:{5}", sysTime.wDay, sysTime.wMonth, sysTime.wYear, sysTime.wHour, sysTime.wMinute, sysTime.wSecond) Catch e As TypeLoadException Console.WriteLine(("TypeLoadException : " + e.Message.ToString())) diff --git a/snippets/visualbasic/VS_Snippets_Remoting/NclNegoasyncClient/VB/client.vb b/snippets/visualbasic/VS_Snippets_Remoting/NclNegoasyncClient/VB/client.vb new file mode 100644 index 00000000000..1aef8cc8f3a --- /dev/null +++ b/snippets/visualbasic/VS_Snippets_Remoting/NclNegoasyncClient/VB/client.vb @@ -0,0 +1,111 @@ +' +Imports System.Text +Imports System.Net.Sockets +Imports System.Net.Security +Imports System.Net + +Namespace Examples.NegotiateStreamExample + + Public Class ASynchronousAuthenticatingTcpClient + + Shared client As TcpClient = Nothing + + Public Shared Sub Main(args As String()) + ' + ' + ' Establish the remote endpoint for the socket. + ' For this example, use the local machine. + Dim ipHostInfo = Dns.GetHostEntry("localhost") + Dim ipAddress = ipHostInfo.AddressList(0) + + ' Client and server use port 11000. + Dim remoteEP As New IPEndPoint(ipAddress, 11000) + + ' Create a TCP/IP socket. + client = New TcpClient() + + ' Connect the socket to the remote endpoint. + client.Connect(remoteEP) + Console.WriteLine("Client connected to {0}.", remoteEP.ToString()) + + ' Ensure the client does not close when there is + ' still data to be sent to the server. + client.LingerState = (New LingerOption(True, 0)) + + ' + ' Request authentication. + Dim clientStream = client.GetStream() + Dim authStream As New NegotiateStream(clientStream, False) + ' + + ' Pass the NegotiateStream as the AsyncState object + ' so that it is available to the callback delegate. + Dim ar = authStream.BeginAuthenticateAsClient( + New AsyncCallback(AddressOf EndAuthenticateCallback), authStream) + ' + + Console.WriteLine("Client waiting for authentication...") + + ' Wait until the result is available. + ar.AsyncWaitHandle.WaitOne() + + ' Display the properties of the authenticated stream. + AuthenticatedStreamReporter.DisplayProperties(authStream) + + ' Send a message to the server. + ' Encode the test data into a byte array. + Dim message = Encoding.UTF8.GetBytes("Hello from the client.") + ar = authStream.BeginWrite(message, 0, message.Length, + New AsyncCallback(AddressOf EndWriteCallback), authStream) + ' + ar.AsyncWaitHandle.WaitOne() + Console.WriteLine("Sent {0} bytes.", message.Length) + + ' Close the client connection. + authStream.Close() + Console.WriteLine("Client closed.") + + End Sub + + ' + ' The following method is called when the authentication completes. + Public Shared Sub EndAuthenticateCallback(ar As IAsyncResult) + + Console.WriteLine("Client ending authentication...") + Dim authStream = CType(ar.AsyncState, NegotiateStream) + Console.WriteLine("ImpersonationLevel: {0}", authStream.ImpersonationLevel) + + ' End the asynchronous operation. + authStream.EndAuthenticateAsClient(ar) + + End Sub + + ' + ' + ' The following method is called when the write operation completes. + Public Shared Sub EndWriteCallback(ar As IAsyncResult) + + Console.WriteLine("Client ending write operation...") + Dim authStream = CType(ar.AsyncState, NegotiateStream) + + ' End the asynchronous operation. + authStream.EndWrite(ar) + + End Sub + ' + End Class + + ' + ' The following class displays the properties of an AuthenticatedStream. + Public Class AuthenticatedStreamReporter + Public Shared Sub DisplayProperties(stream As AuthenticatedStream) + Console.WriteLine("IsAuthenticated: {0}", stream.IsAuthenticated) + Console.WriteLine("IsMutuallyAuthenticated: {0}", stream.IsMutuallyAuthenticated) + Console.WriteLine("IsEncrypted: {0}", stream.IsEncrypted) + Console.WriteLine("IsSigned: {0}", stream.IsSigned) + Console.WriteLine("IsServer: {0}", stream.IsServer) + End Sub + End Class + ' +End Namespace +' diff --git a/snippets/visualbasic/VS_Snippets_Wpf/datagrid_rowheader/vb/datagrid_rowheader_vb/window1.xaml.vb b/snippets/visualbasic/VS_Snippets_Wpf/datagrid_rowheader/vb/datagrid_rowheader_vb/window1.xaml.vb index 54e9c2a6dd0..af9438f6cbc 100644 --- a/snippets/visualbasic/VS_Snippets_Wpf/datagrid_rowheader/vb/datagrid_rowheader_vb/window1.xaml.vb +++ b/snippets/visualbasic/VS_Snippets_Wpf/datagrid_rowheader/vb/datagrid_rowheader_vb/window1.xaml.vb @@ -28,13 +28,11 @@ Public Class ConvertItemToIndex Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert Try - 'Get the DataRowView that is being passed to the Converter - Dim drv As System.Data.DataRowView = DirectCast(value, System.Data.DataRowView) 'Get the CollectionView from the DataGrid that is using the converter Dim dg As DataGrid = DirectCast(Application.Current.MainWindow.FindName("DG1"), DataGrid) Dim cv As CollectionView = DirectCast(dg.Items, CollectionView) - 'Get the index of the DataRowView from the CollectionView - Dim rowindex As Integer = cv.IndexOf(drv) + 1 + 'Get the index of the item from the CollectionView + Dim rowindex As Integer = cv.IndexOf(value) + 1 Return rowindex.ToString()