From b6ee36cca1a9f2f5126464d4213705d0b92be617 Mon Sep 17 00:00:00 2001 From: Ivan Kochurkin Date: Tue, 15 Sep 2020 16:30:45 +0300 Subject: [PATCH 1/3] Add NetCoreTest.csproj and test, change net461 to netstandard2.0 in Confuser.UnitTest.csproj --- Confuser2.sln | 14 ++++++++++++++ Tests/Confuser.UnitTest/Confuser.UnitTest.csproj | 2 +- Tests/NetCore.Test/NetCore.Test.csproj | 15 +++++++++++++++ Tests/NetCore.Test/NetCoreTest.cs | 14 ++++++++++++++ Tests/NetCore/Class1.cs | 11 +++++++++++ Tests/NetCore/NetCore.csproj | 7 +++++++ Tests/NetCore/Program.cs | 11 +++++++++++ 7 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 Tests/NetCore.Test/NetCore.Test.csproj create mode 100644 Tests/NetCore.Test/NetCoreTest.cs create mode 100644 Tests/NetCore/Class1.cs create mode 100644 Tests/NetCore/NetCore.csproj create mode 100644 Tests/NetCore/Program.cs diff --git a/Confuser2.sln b/Confuser2.sln index 8069d2aea..b73eae126 100644 --- a/Confuser2.sln +++ b/Confuser2.sln @@ -96,6 +96,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IncorrectRedirectToGac", "T EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IncorrectRedirectToGac.Test", "Tests\IncorrectRedirectToGac.Test\IncorrectRedirectToGac.Test.csproj", "{B7FF0EE8-6C68-46C6-AADB-58C0E3309FB2}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetCore.Test", "Tests\NetCore.Test\NetCore.Test.csproj", "{148B6251-FF1F-491F-A1C2-6F1D39AEA361}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetCore", "Tests\NetCore\NetCore.csproj", "{89E07BFD-D11F-44DA-9CC3-AFA08184D651}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -258,6 +262,14 @@ Global {B7FF0EE8-6C68-46C6-AADB-58C0E3309FB2}.Debug|Any CPU.Build.0 = Debug|Any CPU {B7FF0EE8-6C68-46C6-AADB-58C0E3309FB2}.Release|Any CPU.ActiveCfg = Release|Any CPU {B7FF0EE8-6C68-46C6-AADB-58C0E3309FB2}.Release|Any CPU.Build.0 = Release|Any CPU + {148B6251-FF1F-491F-A1C2-6F1D39AEA361}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {148B6251-FF1F-491F-A1C2-6F1D39AEA361}.Debug|Any CPU.Build.0 = Debug|Any CPU + {148B6251-FF1F-491F-A1C2-6F1D39AEA361}.Release|Any CPU.ActiveCfg = Release|Any CPU + {148B6251-FF1F-491F-A1C2-6F1D39AEA361}.Release|Any CPU.Build.0 = Release|Any CPU + {89E07BFD-D11F-44DA-9CC3-AFA08184D651}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {89E07BFD-D11F-44DA-9CC3-AFA08184D651}.Debug|Any CPU.Build.0 = Debug|Any CPU + {89E07BFD-D11F-44DA-9CC3-AFA08184D651}.Release|Any CPU.ActiveCfg = Release|Any CPU + {89E07BFD-D11F-44DA-9CC3-AFA08184D651}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -294,6 +306,8 @@ Global {87BEF4D7-813E-48BA-96FE-E3A24BF2DC34} = {356BDB31-853E-43BB-8F9A-D8AC08F69EBB} {9B823D93-BF1B-407B-A4CD-231347F656AD} = {356BDB31-853E-43BB-8F9A-D8AC08F69EBB} {B7FF0EE8-6C68-46C6-AADB-58C0E3309FB2} = {356BDB31-853E-43BB-8F9A-D8AC08F69EBB} + {148B6251-FF1F-491F-A1C2-6F1D39AEA361} = {356BDB31-853E-43BB-8F9A-D8AC08F69EBB} + {89E07BFD-D11F-44DA-9CC3-AFA08184D651} = {356BDB31-853E-43BB-8F9A-D8AC08F69EBB} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {0D937D9E-E04B-4A68-B639-D4260473A388} diff --git a/Tests/Confuser.UnitTest/Confuser.UnitTest.csproj b/Tests/Confuser.UnitTest/Confuser.UnitTest.csproj index 0bf0a503e..563322a6d 100644 --- a/Tests/Confuser.UnitTest/Confuser.UnitTest.csproj +++ b/Tests/Confuser.UnitTest/Confuser.UnitTest.csproj @@ -3,7 +3,7 @@ - net461 + netstandard2.0 diff --git a/Tests/NetCore.Test/NetCore.Test.csproj b/Tests/NetCore.Test/NetCore.Test.csproj new file mode 100644 index 000000000..7c82a23ac --- /dev/null +++ b/Tests/NetCore.Test/NetCore.Test.csproj @@ -0,0 +1,15 @@ + + + + netcoreapp2.1 + + + + + + + + + + + diff --git a/Tests/NetCore.Test/NetCoreTest.cs b/Tests/NetCore.Test/NetCoreTest.cs new file mode 100644 index 000000000..dddb591f0 --- /dev/null +++ b/Tests/NetCore.Test/NetCoreTest.cs @@ -0,0 +1,14 @@ +using System.Threading.Tasks; +using Confuser.UnitTest; +using Xunit; +using Xunit.Abstractions; + +namespace NetCore.Test { + public class NetCoreTest : TestBase { + public NetCoreTest(ITestOutputHelper outputHelper) : base(outputHelper) { } + + [Fact] + public async Task NetCore() => + await Run("NetCore.dll", new string[0], null); + } +} diff --git a/Tests/NetCore/Class1.cs b/Tests/NetCore/Class1.cs new file mode 100644 index 000000000..1979b8377 --- /dev/null +++ b/Tests/NetCore/Class1.cs @@ -0,0 +1,11 @@ +using System; + +namespace NetCore { + public class Class1 { + public int GetARandomInt() { + object o = null; + var test = o?.GetType()?.Name; + return new Random().Next(); + } + } +} diff --git a/Tests/NetCore/NetCore.csproj b/Tests/NetCore/NetCore.csproj new file mode 100644 index 000000000..aa5bb1091 --- /dev/null +++ b/Tests/NetCore/NetCore.csproj @@ -0,0 +1,7 @@ + + + + netcoreapp2.1 + + + diff --git a/Tests/NetCore/Program.cs b/Tests/NetCore/Program.cs new file mode 100644 index 000000000..a7a554ab0 --- /dev/null +++ b/Tests/NetCore/Program.cs @@ -0,0 +1,11 @@ +using System; + +namespace NetCore { + public class Program { + static int Main(string[] args) { + Console.WriteLine("START"); + Console.WriteLine("END"); + return 42; + } + } +} From 09c10cf54346c9f57b506a1228f22e9e2ae4cd5c Mon Sep 17 00:00:00 2001 From: Ivan Kochurkin Date: Fri, 2 Oct 2020 16:07:27 +0300 Subject: [PATCH 2/3] Add Skip attribute with TODO to NetCore test --- Tests/NetCore.Test/NetCoreTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/NetCore.Test/NetCoreTest.cs b/Tests/NetCore.Test/NetCoreTest.cs index dddb591f0..d54ca3190 100644 --- a/Tests/NetCore.Test/NetCoreTest.cs +++ b/Tests/NetCore.Test/NetCoreTest.cs @@ -7,7 +7,7 @@ namespace NetCore.Test { public class NetCoreTest : TestBase { public NetCoreTest(ITestOutputHelper outputHelper) : base(outputHelper) { } - [Fact] + [Fact(Skip = "TODO: fix https://github.com/mkaring/ConfuserEx/issues/106 and other related")] public async Task NetCore() => await Run("NetCore.dll", new string[0], null); } From 0745292eee232ec74d004ed14ba47d6260469341 Mon Sep 17 00:00:00 2001 From: Ivan Kochurkin Date: Fri, 2 Oct 2020 16:15:02 +0300 Subject: [PATCH 3/3] Try to update Visual Studio to 2019 to support netcore --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index a2f4e9f3d..625d2de58 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ version: '{build}' -image: Visual Studio 2017 +image: Visual Studio 2019 configuration: Release platform: Any CPU skip_commits: