From f9d7dda81bbf85f32f07c2f301b00ebc2b952983 Mon Sep 17 00:00:00 2001
From: qwj <qwjzorro@163.com>
Date: 星期三, 16 八月 2023 11:30:10 +0800
Subject: [PATCH] FileServer发布环境修改
---
DocumentFile.Service/Properties/launchSettings.json | 21 ++++++++++
DocumentFile.Service/DocumentFile.Service.csproj | 11 +++++
DocumentFile.Service/Program.cs | 11 +++--
DocumentFile.Service/Properties/PublishProfiles/FolderProfile.pubxml | 22 +++++++++++
4 files changed, 59 insertions(+), 6 deletions(-)
diff --git a/DocumentFile.Service/DocumentFile.Service.csproj b/DocumentFile.Service/DocumentFile.Service.csproj
index bb097a0..384819b 100644
--- a/DocumentFile.Service/DocumentFile.Service.csproj
+++ b/DocumentFile.Service/DocumentFile.Service.csproj
@@ -4,7 +4,8 @@
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
- <PlatformTarget>x64</PlatformTarget>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <IsPublishable>True</IsPublishable>
</PropertyGroup>
<ItemGroup>
@@ -14,4 +15,12 @@
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
</ItemGroup>
+ <ItemGroup>
+ <None Update="Properties\launchSettings.json">
+ <CopyToOutputDirectory>Never</CopyToOutputDirectory>
+ <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
+ <CopyToPublishDirectory>Never</CopyToPublishDirectory>
+ </None>
+ </ItemGroup>
+
</Project>
diff --git a/DocumentFile.Service/Program.cs b/DocumentFile.Service/Program.cs
index b808f8e..17cc37e 100644
--- a/DocumentFile.Service/Program.cs
+++ b/DocumentFile.Service/Program.cs
@@ -37,11 +37,14 @@
var app = builder.Build();
// Configure the HTTP request pipeline.
-if (app.Environment.IsDevelopment())
+app.UseSwagger();
+app.UseSwaggerUI(c =>
{
- app.UseSwagger();
- app.UseSwaggerUI();
-}
+ c.SwaggerEndpoint("/swagger/v1/swagger.json", "V1 Docs");
+ c.RoutePrefix = string.Empty;
+ c.DocExpansion(Swashbuckle.AspNetCore.SwaggerUI.DocExpansion.None);
+ c.DefaultModelsExpandDepth(-1);
+});
app.UseHttpsRedirection();
diff --git a/DocumentFile.Service/Properties/PublishProfiles/FolderProfile.pubxml b/DocumentFile.Service/Properties/PublishProfiles/FolderProfile.pubxml
new file mode 100644
index 0000000..371fef4
--- /dev/null
+++ b/DocumentFile.Service/Properties/PublishProfiles/FolderProfile.pubxml
@@ -0,0 +1,22 @@
+锘�<?xml version="1.0" encoding="utf-8"?>
+<!--
+https://go.microsoft.com/fwlink/?LinkID=208121.
+-->
+<Project>
+ <PropertyGroup>
+ <DeleteExistingFiles>true</DeleteExistingFiles>
+ <ExcludeApp_Data>false</ExcludeApp_Data>
+ <LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
+ <LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
+ <LastUsedPlatform>Any CPU</LastUsedPlatform>
+ <PublishProvider>FileSystem</PublishProvider>
+ <PublishUrl>bin\Debug\net6.0\publish\</PublishUrl>
+ <WebPublishMethod>FileSystem</WebPublishMethod>
+ <_TargetId>Folder</_TargetId>
+ <SiteUrlToLaunchAfterPublish />
+ <TargetFramework>net6.0</TargetFramework>
+ <RuntimeIdentifier>win-x64</RuntimeIdentifier>
+ <ProjectGuid>f3449ef6-8e3f-492f-832f-f5f2e1f2503c</ProjectGuid>
+ <SelfContained>false</SelfContained>
+ </PropertyGroup>
+</Project>
\ No newline at end of file
diff --git a/DocumentFile.Service/Properties/launchSettings.json b/DocumentFile.Service/Properties/launchSettings.json
index 63b94f2..f1f0e92 100644
--- a/DocumentFile.Service/Properties/launchSettings.json
+++ b/DocumentFile.Service/Properties/launchSettings.json
@@ -1,12 +1,31 @@
{
"profiles": {
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "launchUrl": "http://localhost:54000/index.html",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
"DocumentFile.Service": {
"commandName": "Project",
"launchBrowser": true,
+ "launchUrl": "https://localhost:6001/index.html",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
- "applicationUrl": "https://localhost:52095;http://localhost:52096"
+ "dotnetRunMessages": true,
+ "applicationUrl": "https://localhost:6001;http://localhost:6000"
+ }
+ },
+ "$schema": "http://json.schemastore.org/launchsettings.json",
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:54000/",
+ "sslPort": 0
}
}
}
\ No newline at end of file
--
Gitblit v1.9.1