From d46cbe601a9d5d4437f256a496f29a3fe6881da8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Fri, 22 May 2020 03:33:37 +0200 Subject: [PATCH] use DllMapCore for native dll path resolutions --- Crow.sln | 4 ++-- Crow/App.config | 6 ++++++ Crow/Crow.csproj | 2 +- Samples/BasicTests/BasicTests.cs | 6 ++++-- Samples/ControlLib/ControlLib.csproj | 1 - Samples/Directory.Build.props | 4 ++-- Samples/HelloWorld/main.cs | 3 +++ .../PerfTests}/PerfTests.csproj | 12 ++--------- {PerfTests => Samples/PerfTests}/Program.cs | 0 Samples/ShowCase/{main.cs => ShowCase.cs} | 20 ++++++++----------- Samples/ShowCase/ShowCase.csproj | 3 +-- Samples/common/SampleBase.cs | 2 +- unitTests/unitTests.csproj | 4 ---- 13 files changed, 30 insertions(+), 37 deletions(-) create mode 100644 Crow/App.config rename {PerfTests => Samples/PerfTests}/PerfTests.csproj (80%) rename {PerfTests => Samples/PerfTests}/Program.cs (100%) rename Samples/ShowCase/{main.cs => ShowCase.cs} (89%) diff --git a/Crow.sln b/Crow.sln index d8a144c8..159a127b 100644 --- a/Crow.sln +++ b/Crow.sln @@ -22,7 +22,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "unitTests", "unitTests\unit EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BasicTests", "Samples\BasicTests\BasicTests.csproj", "{7AEB6DD5-916E-4415-84E1-78EC6E5881CE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PerfTests", "PerfTests\PerfTests.csproj", "{18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PerfTests", "Samples\PerfTests\PerfTests.csproj", "{18EBB41F-815E-4BF5-B80F-C9E2FAB2993A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -65,6 +65,7 @@ Global {56329D48-D382-4850-93DE-59C453894E8A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6} {91F1CE07-EECE-4F1D-A3EE-7239B563654A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6} {7AEB6DD5-916E-4415-84E1-78EC6E5881CE} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6} + {18EBB41F-815E-4BF5-B80F-C9E2FAB2993A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {00D4E149-7131-49F4-BAAD-559AA961A78E} @@ -105,6 +106,5 @@ Global $6.LineAlign = 0 $6.Wrap = False description = @C.R.O.W. c# Rapid Open Widgets\n\nCrow is a pure c# widget toolkit with XML definition of interface, bindings, styling...\n - version = 0.8.0 EndGlobalSection EndGlobal diff --git a/Crow/App.config b/Crow/App.config new file mode 100644 index 00000000..6651a783 --- /dev/null +++ b/Crow/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/Crow/Crow.csproj b/Crow/Crow.csproj index 2e1911d7..587ca78c 100644 --- a/Crow/Crow.csproj +++ b/Crow/Crow.csproj @@ -4,7 +4,6 @@ netstandard2.0 $(CrowVersion) - $(CrowVersion) $(CrowPackageVersion) C# Rapid Open Widget Toolkit @@ -29,6 +28,7 @@ _DESIGN_MODE false false + App.config full diff --git a/Samples/BasicTests/BasicTests.cs b/Samples/BasicTests/BasicTests.cs index b0d99ccc..fba4b70a 100644 --- a/Samples/BasicTests/BasicTests.cs +++ b/Samples/BasicTests/BasicTests.cs @@ -10,9 +10,11 @@ namespace tests { public class BasicTests : SampleBase { - [STAThread] static void Main () { +#if NETCOREAPP3_1 + DllMapCore.Resolve.Enable (true); +#endif using (BasicTests app = new BasicTests ()) { app.Run (); } @@ -96,7 +98,7 @@ namespace tests else if (idx < 0) idx = testFiles.Length - 1; - Console.WriteLine ($"Loading {testFiles [idx]}."); + Console.WriteLine ($"Loading {testFiles [idx]}. {AppDomain.CurrentDomain.MonitoringSurvivedMemorySize}"); Load (testFiles [idx]).DataSource = this; } catch (Exception ex) { diff --git a/Samples/ControlLib/ControlLib.csproj b/Samples/ControlLib/ControlLib.csproj index c82431e8..e9d01df9 100644 --- a/Samples/ControlLib/ControlLib.csproj +++ b/Samples/ControlLib/ControlLib.csproj @@ -2,7 +2,6 @@ net472;netstandard2.0 false - 0.8.0 diff --git a/Samples/Directory.Build.props b/Samples/Directory.Build.props index d3e9d668..d2f140e7 100644 --- a/Samples/Directory.Build.props +++ b/Samples/Directory.Build.props @@ -15,10 +15,10 @@ false $(SolutionDir)Samples\ - - + + diff --git a/Samples/HelloWorld/main.cs b/Samples/HelloWorld/main.cs index 44ec3fb8..743419ee 100644 --- a/Samples/HelloWorld/main.cs +++ b/Samples/HelloWorld/main.cs @@ -5,6 +5,9 @@ namespace HelloWorld { class Program { static void Main (string[] args) { +#if NETCOREAPP3_1 + DllMapCore.Resolve.Enable (true); +#endif using (Interface app = new Interface ()) { app.Initialized += (sender, e) => (sender as Interface).Load ("#HelloWorld.helloworld.crow"); app.Run (); diff --git a/PerfTests/PerfTests.csproj b/Samples/PerfTests/PerfTests.csproj similarity index 80% rename from PerfTests/PerfTests.csproj rename to Samples/PerfTests/PerfTests.csproj index dc735db5..982bd359 100644 --- a/PerfTests/PerfTests.csproj +++ b/Samples/PerfTests/PerfTests.csproj @@ -1,15 +1,7 @@ - - net472 - Exe - 0.8.0 - - - - - + diff --git a/PerfTests/Program.cs b/Samples/PerfTests/Program.cs similarity index 100% rename from PerfTests/Program.cs rename to Samples/PerfTests/Program.cs diff --git a/Samples/ShowCase/main.cs b/Samples/ShowCase/ShowCase.cs similarity index 89% rename from Samples/ShowCase/main.cs rename to Samples/ShowCase/ShowCase.cs index b65f3dfe..10da3683 100644 --- a/Samples/ShowCase/main.cs +++ b/Samples/ShowCase/ShowCase.cs @@ -1,33 +1,29 @@ -// Copyright (c) 2013-2019 Bruyère Jean-Philippe +// Copyright (c) 2013-2019 Bruyère Jean-Philippe // // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; using Crow; using System.IO; -using System.Collections.Generic; -using System.Reflection; -using System.Linq; using System.Text; using Crow.IML; -namespace tests +namespace ShowCase { class Showcase : Interface { - public Container crowContainer; - [STAThread] static void Main () { - using (Showcase app = new Showcase ()) { - //app.Keyboard.KeyDown += App_KeyboardKeyDown; - +#if NETCOREAPP3_1 + DllMapCore.Resolve.Enable (true); +#endif + using (Showcase app = new Showcase ()) app.Run (); - - } } + public Container crowContainer; + protected override void OnInitialized () { Widget g = Load ("#ShowCase.showcase.crow"); diff --git a/Samples/ShowCase/ShowCase.csproj b/Samples/ShowCase/ShowCase.csproj index fe311b56..ad2019cb 100644 --- a/Samples/ShowCase/ShowCase.csproj +++ b/Samples/ShowCase/ShowCase.csproj @@ -1,6 +1,5 @@ - ShowCase.%(Filename)%(Extension) @@ -8,5 +7,5 @@ - + \ No newline at end of file diff --git a/Samples/common/SampleBase.cs b/Samples/common/SampleBase.cs index 8ee0c151..6800e9ef 100644 --- a/Samples/common/SampleBase.cs +++ b/Samples/common/SampleBase.cs @@ -8,7 +8,7 @@ using Crow; namespace Crow { - public class SampleBase : Interface { + public class SampleBase : Interface { public Version CrowVersion => Assembly.GetAssembly (typeof (Widget)).GetName ().Version; #region Test values for Binding diff --git a/unitTests/unitTests.csproj b/unitTests/unitTests.csproj index c3d6dc97..d5f74c99 100644 --- a/unitTests/unitTests.csproj +++ b/unitTests/unitTests.csproj @@ -1,10 +1,6 @@ net472 - 0.8.0 - - - full -- 2.47.3