From a625f19d0de5a41e995e69eb2d8f1ae455ac6291 Mon Sep 17 00:00:00 2001 From: Holger Boerchers Date: Fri, 14 Dec 2018 22:48:42 +0100 Subject: [PATCH] pimped --- .vscode/launch.json | 47 ++++++++++++++++++++++ .vscode/tasks.json | 25 ++++++++++++ InjectorTest/InjectorTest.csproj | 10 +++-- SmallInjectorDemo/Program.cs | 2 +- SmallInjectorDemo/SmallInjector.cs | 4 +- SmallInjectorDemo/SmallInjectorDemo.csproj | 3 +- 6 files changed, 83 insertions(+), 8 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..c478252 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,47 @@ +{ + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/InjectorTest/bin/Debug/netcoreapp2.1/InjectorTest.dll", + "args": [], + "cwd": "${workspaceFolder}/InjectorTest", + // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window + "console": "internalConsole", + "stopAtEntry": false, + "internalConsoleOptions": "openOnSessionStart" + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + , + { + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${workspaceFolder}/InjectorTest/bin/Debug/netcoreapp2.1/InjectorTest.dll", + "args": [], + "cwd": "${workspaceFolder}/InjectorTest", + "console": "internalConsole", + "stopAtEntry": false, + "internalConsoleOptions": "openOnSessionStart" + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..cb9d711 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,25 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/InjectorTest/InjectorTest.csproj" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/InjectorTest/InjectorTest.csproj" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/InjectorTest/InjectorTest.csproj b/InjectorTest/InjectorTest.csproj index 93db71c..8e0ee52 100644 --- a/InjectorTest/InjectorTest.csproj +++ b/InjectorTest/InjectorTest.csproj @@ -1,15 +1,17 @@ - netcoreapp2.1 + netcoreapp2.2 false + + 7.1 - - - + + + all runtime; build; native; contentfiles; analyzers diff --git a/SmallInjectorDemo/Program.cs b/SmallInjectorDemo/Program.cs index 2102cc6..3bf9ee3 100644 --- a/SmallInjectorDemo/Program.cs +++ b/SmallInjectorDemo/Program.cs @@ -29,7 +29,7 @@ namespace SmallInjectorDemo useful2.TestTheServices(); Console.WriteLine(); useful3.TestTheServices(); - Console.ReadLine(); + //Console.ReadLine(); } } } \ No newline at end of file diff --git a/SmallInjectorDemo/SmallInjector.cs b/SmallInjectorDemo/SmallInjector.cs index aa95e4b..84f9802 100644 --- a/SmallInjectorDemo/SmallInjector.cs +++ b/SmallInjectorDemo/SmallInjector.cs @@ -17,7 +17,7 @@ namespace SmallInjectorDemo /// Type of the interface of the service. /// True if the service should be singleton. False otherwise. /// instance of the service - public void RegisterType(bool isSingleton, TService instance = default(TService)) where TService : TInterface + public void RegisterType(bool isSingleton, TService instance = default) where TService : TInterface { _container.Add(typeof(TInterface), new RegisteredType(typeof(TService), isSingleton, null)); } @@ -26,7 +26,7 @@ namespace SmallInjectorDemo /// Register types in the resolve container. /// /// Type of the service. - public void RegisterType(bool isSingleton, TService instance = default(TService)) => RegisterType(isSingleton, instance); + public void RegisterType(bool isSingleton, TService instance = default) => RegisterType(isSingleton, instance); /// /// Resolve service of specified type. diff --git a/SmallInjectorDemo/SmallInjectorDemo.csproj b/SmallInjectorDemo/SmallInjectorDemo.csproj index c4c4003..9627fca 100644 --- a/SmallInjectorDemo/SmallInjectorDemo.csproj +++ b/SmallInjectorDemo/SmallInjectorDemo.csproj @@ -1,9 +1,10 @@  Exe - netcoreapp2.1 + netcoreapp2.2 SmallInjectorDemo SmallInjectorDemo + latest bin\Debug\netcoreapp2.1\SmallInjectorDemo.xml