Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DataCenter_Core2.1_20190520
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
DataCenter_Core2.1_20190520
Commits
b7e3071c
Commit
b7e3071c
authored
Aug 24, 2021
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netcore2.1升级到3.1
parent
37dcbea8
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
18 deletions
+30
-18
Bailun.DC.Web.csproj
Bailun.DC.Web/Bailun.DC.Web.csproj
+2
-2
Dockerfile
Bailun.DC.Web/Dockerfile
+1
-1
Program.cs
Bailun.DC.Web/Program.cs
+21
-12
Startup.cs
Bailun.DC.Web/Startup.cs
+6
-3
No files found.
Bailun.DC.Web/Bailun.DC.Web.csproj
View file @
b7e3071c
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp
2
.1</TargetFramework>
<TargetFramework>netcoreapp
3
.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
...
...
@@ -18,7 +18,7 @@
<PackageReference Include="Bailun.ServiceFabric.Core" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.7" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.
1.3
" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.
2.0
" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.1.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.14" />
...
...
Bailun.DC.Web/Dockerfile
View file @
b7e3071c
...
...
@@ -3,7 +3,7 @@ WORKDIR /app
EXPOSE
80
RUN
/bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
&&
echo
'Asia/Shanghai'
>
/etc/timezone
FROM
microsoft/dotnet:
2
.1-sdk AS build
FROM
microsoft/dotnet:
3
.1-sdk AS build
WORKDIR
/src
COPY
Bailun.DC.Web/Bailun.DC.Web.csproj Bailun.DC.Web/
COPY
Bailun.DC.Services/Bailun.DC.Services.csproj Bailun.DC.Services/
...
...
Bailun.DC.Web/Program.cs
View file @
b7e3071c
...
...
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using
Microsoft.AspNetCore
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.Hosting
;
using
Microsoft.Extensions.Logging
;
namespace
Bailun.DC.Web
...
...
@@ -14,20 +15,28 @@ namespace Bailun.DC.Web
{
public
static
void
Main
(
string
[]
args
)
{
Create
Web
HostBuilder
(
args
).
Build
().
Run
();
CreateHostBuilder
(
args
).
Build
().
Run
();
}
public
static
IWebHostBuilder
CreateWebHostBuilder
(
string
[]
args
)
=>
WebHost
.
CreateDefaultBuilder
(
args
)
.
UseKestrel
(
options
=>
public
static
IHostBuilder
CreateHostBuilder
(
string
[]
args
)
=>
Host
.
CreateDefaultBuilder
(
args
)
.
ConfigureWebHostDefaults
(
webBuilder
=>
{
options
.
Limits
.
MaxRequestBodySize
=
200
*
1024
*
1024
;
// 200M
})
//.UseHttpSys(options =>
//{
// options.MaxRequestBodySize = 100_000_000;
//})
.
UseStartup
<
Startup
>()
;
webBuilder
.
UseStartup
<
Startup
>();
});
//public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
// WebHost.CreateDefaultBuilder(args)
// .UseKestrel(options =>
// {
// options.Limits.MaxRequestBodySize = 200*1024*1024; // 200M
// })
// //.UseHttpSys(options =>
// //{
// // options.MaxRequestBodySize = 100_000_000;
// //})
// .UseStartup<Startup>()
// ;
}
}
Bailun.DC.Web/Startup.cs
View file @
b7e3071c
...
...
@@ -51,15 +51,18 @@ namespace Bailun.DC.Web
//注入session服务
//services.AddSession();
services
.
AddMvc
().
SetCompatibilityVersion
(
CompatibilityVersion
.
Version_2_1
);
services
.
AddControllersWithViews
().
AddMvcOptions
(
options
=>
{
options
.
EnableEndpointRouting
=
false
;
}).
SetCompatibilityVersion
(
CompatibilityVersion
.
Version_3_0
);
services
.
TryAddSingleton
<
IHttpContextAccessor
,
HttpContextAccessor
>();
services
.
AddSingleton
(
HtmlEncoder
.
Create
(
UnicodeRanges
.
All
));
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public
void
Configure
(
IApplicationBuilder
app
,
I
Hosting
Environment
env
)
public
void
Configure
(
IApplicationBuilder
app
,
I
WebHost
Environment
env
)
{
if
(
env
.
IsDevelopment
()
)
if
(
env
.
EnvironmentName
==
"DEBUG"
)
{
app
.
UseDeveloperExceptionPage
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment