Commit 4c8b5b44 by cairongzhi

升级3.1

parent 2052f7ef
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />
<PackageReference Include="WebApiClient.JIT" Version="1.1.3" /> <PackageReference Include="WebApiClient.JIT" Version="1.1.3" />
</ItemGroup> </ItemGroup>
......
...@@ -34,14 +34,18 @@ namespace SimpleApi ...@@ -34,14 +34,18 @@ namespace SimpleApi
opt.HttpHost = new Uri("http://localhost:5001/"); opt.HttpHost = new Uri("http://localhost:5001/");
}); });
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); services.AddControllers();
} }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env) public void Configure(IApplicationBuilder app)
{ {
app.UseBailunRequestLogging(); app.UseBailunRequestLogging();
app.UseMvc(); app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
} }
} }
......
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance> <PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild> <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Exceptionless" Version="4.3.2027" /> <FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.1.1" /> </ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.1.1" /> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.1.1" /> <PackageReference Include="Exceptionless" Version="4.4.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.1.1" /> <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.1.1" /> <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Http" Version="2.1.1" /> <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Http" Version="3.1.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Serilog" Version="2.9.0" /> <PackageReference Include="Serilog" Version="2.9.0" />
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" /> <PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="SkyAPM.Agent.AspNetCore" Version="0.9.0" /> <PackageReference Include="SkyAPM.Agent.AspNetCore" Version="0.9.0" />
......
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.AspNetCore.Http.Internal;
using Microsoft.AspNetCore.Mvc.Abstractions;
using Newtonsoft.Json; using Newtonsoft.Json;
using Microsoft.AspNetCore.Http.Extensions;
using SkyApm; using SkyApm;
using SkyApm.Common; using SkyApm.Common;
using SkyApm.Diagnostics; using SkyApm.Diagnostics;
...@@ -90,14 +88,14 @@ namespace Bailun.Diagnostics.AspNetCore ...@@ -90,14 +88,14 @@ namespace Bailun.Diagnostics.AspNetCore
} }
//[DiagnosticName("Microsoft.AspNetCore.Mvc.BeforeAction")] //[DiagnosticName("Microsoft.AspNetCore.Mvc.BeforeAction")]
public void BeforeAction([Property] ActionDescriptor actionDescriptor, [Property] HttpContext httpContext) //public void BeforeAction([Property] ActionDescriptor actionDescriptor, [Property] HttpContext httpContext)
{ //{
} //}
//[DiagnosticName("Microsoft.AspNetCore.Mvc.AfterAction")] ////[DiagnosticName("Microsoft.AspNetCore.Mvc.AfterAction")]
public void AfterAction([Property] ActionDescriptor actionDescriptor, [Property] HttpContext httpContext) //public void AfterAction([Property] ActionDescriptor actionDescriptor, [Property] HttpContext httpContext)
{ //{
} //}
} }
internal static class StringExtension internal static class StringExtension
...@@ -108,7 +106,7 @@ namespace Bailun.Diagnostics.AspNetCore ...@@ -108,7 +106,7 @@ namespace Bailun.Diagnostics.AspNetCore
if (request.ContentLength == null || !(request.ContentLength > 0)) if (request.ContentLength == null || !(request.ContentLength > 0))
return body; return body;
request.EnableRewind(); request.EnableBuffering();
request.Body.Seek(0, SeekOrigin.Begin); request.Body.Seek(0, SeekOrigin.Begin);
var buffer = new byte[Convert.ToInt32(request.ContentLength)]; var buffer = new byte[Convert.ToInt32(request.ContentLength)];
......
...@@ -6,6 +6,7 @@ using Microsoft.Extensions.DependencyInjection; ...@@ -6,6 +6,7 @@ using Microsoft.Extensions.DependencyInjection;
using SkyApm; using SkyApm;
using Bailun.Diagnostics.AspNetCore; using Bailun.Diagnostics.AspNetCore;
using Bailun.Diagnostics.HttpClient; using Bailun.Diagnostics.HttpClient;
using Microsoft.Extensions.Hosting;
namespace Microsoft.AspNetCore.Hosting namespace Microsoft.AspNetCore.Hosting
{ {
......
...@@ -6,7 +6,6 @@ using Serilog.AspNetCore; ...@@ -6,7 +6,6 @@ using Serilog.AspNetCore;
using System; using System;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Microsoft.AspNetCore.Http.Internal;
namespace Microsoft.AspNetCore.Builder namespace Microsoft.AspNetCore.Builder
{ {
......
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment