diff --git a/NLogStudy.CoreApp2.ConsoleApp/NLogStudy.CoreApp2.ConsoleApp.csproj b/NLogStudy.CoreApp2.ConsoleApp/NLogStudy.CoreApp2.ConsoleApp.csproj new file mode 100644 index 0000000..958d2f1 --- /dev/null +++ b/NLogStudy.CoreApp2.ConsoleApp/NLogStudy.CoreApp2.ConsoleApp.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.0 + + + diff --git a/NLogStudy.CoreApp2.ConsoleApp/Program.cs b/NLogStudy.CoreApp2.ConsoleApp/Program.cs new file mode 100644 index 0000000..a4dfc90 --- /dev/null +++ b/NLogStudy.CoreApp2.ConsoleApp/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace NLogStudy.CoreApp2.ConsoleApp +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +} diff --git a/NLogStudy.CoreWeb2.Default/Controllers/ValuesController.cs b/NLogStudy.CoreWeb2.Default/Controllers/ValuesController.cs new file mode 100644 index 0000000..25e06df --- /dev/null +++ b/NLogStudy.CoreWeb2.Default/Controllers/ValuesController.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace NLogStudy.CoreWeb2.Default.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class ValuesController : ControllerBase + { + // GET api/values + [HttpGet] + public ActionResult> Get() + { + + return new string[] { "value1", "value2" }; + } + + // GET api/values/5 + [HttpGet("{id}")] + public ActionResult Get(int id) + { + return "value"; + } + + // POST api/values + [HttpPost] + public void Post([FromBody] string value) + { + } + + // PUT api/values/5 + [HttpPut("{id}")] + public void Put(int id, [FromBody] string value) + { + } + + // DELETE api/values/5 + [HttpDelete("{id}")] + public void Delete(int id) + { + } + } +} diff --git a/NLogStudy.CoreWeb2.Default/NLogStudy.CoreWeb2.Default.csproj b/NLogStudy.CoreWeb2.Default/NLogStudy.CoreWeb2.Default.csproj new file mode 100644 index 0000000..423afac --- /dev/null +++ b/NLogStudy.CoreWeb2.Default/NLogStudy.CoreWeb2.Default.csproj @@ -0,0 +1,13 @@ + + + + netcoreapp2.2 + InProcess + + + + + + + + diff --git a/NLogStudy.CoreWeb2.Default/Program.cs b/NLogStudy.CoreWeb2.Default/Program.cs new file mode 100644 index 0000000..2eff778 --- /dev/null +++ b/NLogStudy.CoreWeb2.Default/Program.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; + +namespace NLogStudy.CoreWeb2.Default +{ + public class Program + { + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} diff --git a/NLogStudy.CoreWeb2.Default/Properties/launchSettings.json b/NLogStudy.CoreWeb2.Default/Properties/launchSettings.json new file mode 100644 index 0000000..f7560d8 --- /dev/null +++ b/NLogStudy.CoreWeb2.Default/Properties/launchSettings.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:50088", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "api/values", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "NLogStudy.CoreWeb2.Default": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "api/values", + "applicationUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/NLogStudy.CoreWeb2.Default/Startup.cs b/NLogStudy.CoreWeb2.Default/Startup.cs new file mode 100644 index 0000000..b935891 --- /dev/null +++ b/NLogStudy.CoreWeb2.Default/Startup.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace NLogStudy.CoreWeb2.Default +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseMvc(); + } + } +} diff --git a/NLogStudy.CoreWeb2.Default/appsettings.Development.json b/NLogStudy.CoreWeb2.Default/appsettings.Development.json new file mode 100644 index 0000000..e203e94 --- /dev/null +++ b/NLogStudy.CoreWeb2.Default/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/NLogStudy.CoreWeb2.Default/appsettings.json b/NLogStudy.CoreWeb2.Default/appsettings.json new file mode 100644 index 0000000..def9159 --- /dev/null +++ b/NLogStudy.CoreWeb2.Default/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/NLogStudy.WebCore2.Database/Controllers/ValuesController.cs b/NLogStudy.WebCore2.Database/Controllers/ValuesController.cs new file mode 100644 index 0000000..a348f8d --- /dev/null +++ b/NLogStudy.WebCore2.Database/Controllers/ValuesController.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace NLogStudy.WebCore2.Database.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class ValuesController : ControllerBase + { + // GET api/values + [HttpGet] + public ActionResult> Get() + { + return new string[] { "value1", "value2" }; + } + + // GET api/values/5 + [HttpGet("{id}")] + public ActionResult Get(int id) + { + return "value"; + } + + // POST api/values + [HttpPost] + public void Post([FromBody] string value) + { + } + + // PUT api/values/5 + [HttpPut("{id}")] + public void Put(int id, [FromBody] string value) + { + } + + // DELETE api/values/5 + [HttpDelete("{id}")] + public void Delete(int id) + { + } + } +} diff --git a/NLogStudy.WebCore2.Database/NLogStudy.WebCore2.Database.csproj b/NLogStudy.WebCore2.Database/NLogStudy.WebCore2.Database.csproj new file mode 100644 index 0000000..423afac --- /dev/null +++ b/NLogStudy.WebCore2.Database/NLogStudy.WebCore2.Database.csproj @@ -0,0 +1,13 @@ + + + + netcoreapp2.2 + InProcess + + + + + + + + diff --git a/NLogStudy.WebCore2.Database/Program.cs b/NLogStudy.WebCore2.Database/Program.cs new file mode 100644 index 0000000..ea90292 --- /dev/null +++ b/NLogStudy.WebCore2.Database/Program.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; + +namespace NLogStudy.WebCore2.Database +{ + public class Program + { + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} diff --git a/NLogStudy.WebCore2.Database/Properties/launchSettings.json b/NLogStudy.WebCore2.Database/Properties/launchSettings.json new file mode 100644 index 0000000..fcd6af2 --- /dev/null +++ b/NLogStudy.WebCore2.Database/Properties/launchSettings.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:50162", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "api/values", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "NLogStudy.WebCore2.Database": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "api/values", + "applicationUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/NLogStudy.WebCore2.Database/Startup.cs b/NLogStudy.WebCore2.Database/Startup.cs new file mode 100644 index 0000000..81de342 --- /dev/null +++ b/NLogStudy.WebCore2.Database/Startup.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace NLogStudy.WebCore2.Database +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseMvc(); + } + } +} diff --git a/NLogStudy.WebCore2.Database/appsettings.Development.json b/NLogStudy.WebCore2.Database/appsettings.Development.json new file mode 100644 index 0000000..e203e94 --- /dev/null +++ b/NLogStudy.WebCore2.Database/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/NLogStudy.WebCore2.Database/appsettings.json b/NLogStudy.WebCore2.Database/appsettings.json new file mode 100644 index 0000000..def9159 --- /dev/null +++ b/NLogStudy.WebCore2.Database/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/NLogStudy.WebCore2.Study/Controllers/ValuesController.cs b/NLogStudy.WebCore2.Study/Controllers/ValuesController.cs new file mode 100644 index 0000000..328137e --- /dev/null +++ b/NLogStudy.WebCore2.Study/Controllers/ValuesController.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace NLogStudy.WebCore2.Study.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class ValuesController : ControllerBase + { + // GET api/values + [HttpGet] + public ActionResult> Get() + { + return new string[] { "value1", "value2" }; + } + + // GET api/values/5 + [HttpGet("{id}")] + public ActionResult Get(int id) + { + return "value"; + } + + // POST api/values + [HttpPost] + public void Post([FromBody] string value) + { + } + + // PUT api/values/5 + [HttpPut("{id}")] + public void Put(int id, [FromBody] string value) + { + } + + // DELETE api/values/5 + [HttpDelete("{id}")] + public void Delete(int id) + { + } + } +} diff --git a/NLogStudy.WebCore2.Study/NLogStudy.WebCore2.Study.csproj b/NLogStudy.WebCore2.Study/NLogStudy.WebCore2.Study.csproj new file mode 100644 index 0000000..423afac --- /dev/null +++ b/NLogStudy.WebCore2.Study/NLogStudy.WebCore2.Study.csproj @@ -0,0 +1,13 @@ + + + + netcoreapp2.2 + InProcess + + + + + + + + diff --git a/NLogStudy.WebCore2.Study/Program.cs b/NLogStudy.WebCore2.Study/Program.cs new file mode 100644 index 0000000..7f85d39 --- /dev/null +++ b/NLogStudy.WebCore2.Study/Program.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; + +namespace NLogStudy.WebCore2.Study +{ + public class Program + { + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} diff --git a/NLogStudy.WebCore2.Study/Properties/launchSettings.json b/NLogStudy.WebCore2.Study/Properties/launchSettings.json new file mode 100644 index 0000000..45abab9 --- /dev/null +++ b/NLogStudy.WebCore2.Study/Properties/launchSettings.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:50164", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "api/values", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "NLogStudy.WebCore2.Study": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "api/values", + "applicationUrl": "http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/NLogStudy.WebCore2.Study/Startup.cs b/NLogStudy.WebCore2.Study/Startup.cs new file mode 100644 index 0000000..81ab404 --- /dev/null +++ b/NLogStudy.WebCore2.Study/Startup.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace NLogStudy.WebCore2.Study +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseMvc(); + } + } +} diff --git a/NLogStudy.WebCore2.Study/appsettings.Development.json b/NLogStudy.WebCore2.Study/appsettings.Development.json new file mode 100644 index 0000000..e203e94 --- /dev/null +++ b/NLogStudy.WebCore2.Study/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/NLogStudy.WebCore2.Study/appsettings.json b/NLogStudy.WebCore2.Study/appsettings.json new file mode 100644 index 0000000..def9159 --- /dev/null +++ b/NLogStudy.WebCore2.Study/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/NLogStudy.sln b/NLogStudy.sln new file mode 100644 index 0000000..871bfdd --- /dev/null +++ b/NLogStudy.sln @@ -0,0 +1,60 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29424.173 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLogStudy.CoreWeb2.Default", "NLogStudy.CoreWeb2.Default\NLogStudy.CoreWeb2.Default.csproj", "{2A278A28-28C4-4A90-9BFF-BE85292DD40F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NetCore2", "NetCore2", "{A4009762-9525-445C-AE31-7D240F3E2BA4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NetCore3", "NetCore3", "{CA4D4114-D19A-4CE6-9D67-61198D079741}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documents", "Documents", "{208F7D4B-D0ED-4838-867F-670FAAE04BC3}" + ProjectSection(SolutionItems) = preProject + Study.md = Study.md + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLogStudy.WebCore2.Database", "NLogStudy.WebCore2.Database\NLogStudy.WebCore2.Database.csproj", "{E6F61C33-1123-4CE0-A67F-CB22312E4B6E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLogStudy.WebCore2.Study", "NLogStudy.WebCore2.Study\NLogStudy.WebCore2.Study.csproj", "{C1435088-3E35-47AB-9672-3EA9813771ED}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NetFramework", "NetFramework", "{A4C5C2CC-8F8A-49C9-AAF6-AADA380791F0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLogStudy.CoreApp2.ConsoleApp", "NLogStudy.CoreApp2.ConsoleApp\NLogStudy.CoreApp2.ConsoleApp.csproj", "{36486C33-686F-4289-A393-9638221F597D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2A278A28-28C4-4A90-9BFF-BE85292DD40F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2A278A28-28C4-4A90-9BFF-BE85292DD40F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2A278A28-28C4-4A90-9BFF-BE85292DD40F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2A278A28-28C4-4A90-9BFF-BE85292DD40F}.Release|Any CPU.Build.0 = Release|Any CPU + {E6F61C33-1123-4CE0-A67F-CB22312E4B6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E6F61C33-1123-4CE0-A67F-CB22312E4B6E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E6F61C33-1123-4CE0-A67F-CB22312E4B6E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E6F61C33-1123-4CE0-A67F-CB22312E4B6E}.Release|Any CPU.Build.0 = Release|Any CPU + {C1435088-3E35-47AB-9672-3EA9813771ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C1435088-3E35-47AB-9672-3EA9813771ED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C1435088-3E35-47AB-9672-3EA9813771ED}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C1435088-3E35-47AB-9672-3EA9813771ED}.Release|Any CPU.Build.0 = Release|Any CPU + {36486C33-686F-4289-A393-9638221F597D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {36486C33-686F-4289-A393-9638221F597D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {36486C33-686F-4289-A393-9638221F597D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {36486C33-686F-4289-A393-9638221F597D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {2A278A28-28C4-4A90-9BFF-BE85292DD40F} = {A4009762-9525-445C-AE31-7D240F3E2BA4} + {E6F61C33-1123-4CE0-A67F-CB22312E4B6E} = {A4009762-9525-445C-AE31-7D240F3E2BA4} + {C1435088-3E35-47AB-9672-3EA9813771ED} = {A4009762-9525-445C-AE31-7D240F3E2BA4} + {36486C33-686F-4289-A393-9638221F597D} = {A4009762-9525-445C-AE31-7D240F3E2BA4} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {EB3CF482-270A-4536-9A9B-EA1145B7E859} + EndGlobalSection +EndGlobal diff --git a/Study.md b/Study.md new file mode 100644 index 0000000..cb7946f --- /dev/null +++ b/Study.md @@ -0,0 +1 @@ +# Nlogѧϰ