From f29a0605d50c972bb4f73eeffc8c3da372d0db16 Mon Sep 17 00:00:00 2001 From: Reinhard Saller Date: Mon, 3 Jul 2023 20:46:27 +0200 Subject: [PATCH] Add repro for issue #1102. --- Issue1102/Issue1102.sln | 37 +++++++++++++++++++ .../MyApp.Tests.MSTest.csproj | 22 +++++++++++ Issue1102/MyApp.Tests.MSTest/UnitTest1.cs | 13 +++++++ Issue1102/MyApp.Tests.MSTest/Usings.cs | 1 + .../MyApp.Tests.NUnit.csproj | 23 ++++++++++++ Issue1102/MyApp.Tests.NUnit/UnitTest1.cs | 17 +++++++++ Issue1102/MyApp.Tests.NUnit/Usings.cs | 1 + Issue1102/MyApp/MyApp.csproj | 18 +++++++++ Issue1102/MyApp/Program.cs | 11 ++++++ 9 files changed, 143 insertions(+) create mode 100644 Issue1102/Issue1102.sln create mode 100644 Issue1102/MyApp.Tests.MSTest/MyApp.Tests.MSTest.csproj create mode 100644 Issue1102/MyApp.Tests.MSTest/UnitTest1.cs create mode 100644 Issue1102/MyApp.Tests.MSTest/Usings.cs create mode 100644 Issue1102/MyApp.Tests.NUnit/MyApp.Tests.NUnit.csproj create mode 100644 Issue1102/MyApp.Tests.NUnit/UnitTest1.cs create mode 100644 Issue1102/MyApp.Tests.NUnit/Usings.cs create mode 100644 Issue1102/MyApp/MyApp.csproj create mode 100644 Issue1102/MyApp/Program.cs diff --git a/Issue1102/Issue1102.sln b/Issue1102/Issue1102.sln new file mode 100644 index 0000000..fdee7d7 --- /dev/null +++ b/Issue1102/Issue1102.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33414.496 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyApp", "MyApp\MyApp.csproj", "{E57DC260-DF0C-48FF-9F1E-D3783F7A6819}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyApp.Tests.NUnit", "MyApp.Tests.NUnit\MyApp.Tests.NUnit.csproj", "{FABB63DB-A96F-46EB-8E59-8716F7C45D9A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyApp.Tests.MSTest", "MyApp.Tests.MSTest\MyApp.Tests.MSTest.csproj", "{38BF43CB-5E95-4FB5-93E0-0BD6E4C6C681}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E57DC260-DF0C-48FF-9F1E-D3783F7A6819}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E57DC260-DF0C-48FF-9F1E-D3783F7A6819}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E57DC260-DF0C-48FF-9F1E-D3783F7A6819}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E57DC260-DF0C-48FF-9F1E-D3783F7A6819}.Release|Any CPU.Build.0 = Release|Any CPU + {FABB63DB-A96F-46EB-8E59-8716F7C45D9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FABB63DB-A96F-46EB-8E59-8716F7C45D9A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FABB63DB-A96F-46EB-8E59-8716F7C45D9A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FABB63DB-A96F-46EB-8E59-8716F7C45D9A}.Release|Any CPU.Build.0 = Release|Any CPU + {38BF43CB-5E95-4FB5-93E0-0BD6E4C6C681}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {38BF43CB-5E95-4FB5-93E0-0BD6E4C6C681}.Debug|Any CPU.Build.0 = Debug|Any CPU + {38BF43CB-5E95-4FB5-93E0-0BD6E4C6C681}.Release|Any CPU.ActiveCfg = Release|Any CPU + {38BF43CB-5E95-4FB5-93E0-0BD6E4C6C681}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9D16BE44-66D5-4D92-A8F8-0B13F904DD40} + EndGlobalSection +EndGlobal diff --git a/Issue1102/MyApp.Tests.MSTest/MyApp.Tests.MSTest.csproj b/Issue1102/MyApp.Tests.MSTest/MyApp.Tests.MSTest.csproj new file mode 100644 index 0000000..8033aee --- /dev/null +++ b/Issue1102/MyApp.Tests.MSTest/MyApp.Tests.MSTest.csproj @@ -0,0 +1,22 @@ + + + + net6.0 + enable + enable + + false + + + + + + + + + + + + + + diff --git a/Issue1102/MyApp.Tests.MSTest/UnitTest1.cs b/Issue1102/MyApp.Tests.MSTest/UnitTest1.cs new file mode 100644 index 0000000..097fb95 --- /dev/null +++ b/Issue1102/MyApp.Tests.MSTest/UnitTest1.cs @@ -0,0 +1,13 @@ +namespace MyApp.Tests.MSTest +{ + [TestClass] + public class UnitTest1 + { + [TestMethod] + public void TestMethod1() + { + Program.Main(new string[] { }); + Assert.IsTrue(true); + } + } +} \ No newline at end of file diff --git a/Issue1102/MyApp.Tests.MSTest/Usings.cs b/Issue1102/MyApp.Tests.MSTest/Usings.cs new file mode 100644 index 0000000..ab67c7e --- /dev/null +++ b/Issue1102/MyApp.Tests.MSTest/Usings.cs @@ -0,0 +1 @@ +global using Microsoft.VisualStudio.TestTools.UnitTesting; \ No newline at end of file diff --git a/Issue1102/MyApp.Tests.NUnit/MyApp.Tests.NUnit.csproj b/Issue1102/MyApp.Tests.NUnit/MyApp.Tests.NUnit.csproj new file mode 100644 index 0000000..5b5eb99 --- /dev/null +++ b/Issue1102/MyApp.Tests.NUnit/MyApp.Tests.NUnit.csproj @@ -0,0 +1,23 @@ + + + + net6.0 + enable + enable + + false + + + + + + + + + + + + + + + diff --git a/Issue1102/MyApp.Tests.NUnit/UnitTest1.cs b/Issue1102/MyApp.Tests.NUnit/UnitTest1.cs new file mode 100644 index 0000000..a4e29d5 --- /dev/null +++ b/Issue1102/MyApp.Tests.NUnit/UnitTest1.cs @@ -0,0 +1,17 @@ +namespace MyApp.Tests.NUnit +{ + public class Tests + { + [SetUp] + public void Setup() + { + } + + [Test] + public void Test1() + { + Program.Main(new string[] { }); + Assert.Pass(); + } + } +} \ No newline at end of file diff --git a/Issue1102/MyApp.Tests.NUnit/Usings.cs b/Issue1102/MyApp.Tests.NUnit/Usings.cs new file mode 100644 index 0000000..cefced4 --- /dev/null +++ b/Issue1102/MyApp.Tests.NUnit/Usings.cs @@ -0,0 +1 @@ +global using NUnit.Framework; \ No newline at end of file diff --git a/Issue1102/MyApp/MyApp.csproj b/Issue1102/MyApp/MyApp.csproj new file mode 100644 index 0000000..9384559 --- /dev/null +++ b/Issue1102/MyApp/MyApp.csproj @@ -0,0 +1,18 @@ + + + + Exe + net6.0 + enable + enable + + + + + + + + + + + diff --git a/Issue1102/MyApp/Program.cs b/Issue1102/MyApp/Program.cs new file mode 100644 index 0000000..7621f46 --- /dev/null +++ b/Issue1102/MyApp/Program.cs @@ -0,0 +1,11 @@ +namespace MyApp +{ + internal class Program + { + internal static void Main(string[] args) + { + Console.WriteLine("Hello, world!"); + Console.Error.WriteLine("Hello, error stream!"); + } + } +} \ No newline at end of file