修改目录结构,方便管理

master
bicijinlian 4 years ago
parent 77113e6840
commit 64b3fec604

@ -1,26 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
// 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
"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}/AppDemo/AppDemo/bin/Debug/net5.0/AppDemo.dll",
"args": [],
"cwd": "${workspaceFolder}/AppDemo/AppDemo",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}

42
.vscode/tasks.json vendored

@ -1,42 +0,0 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/AppDemo/AppDemo/AppDemo.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/AppDemo/AppDemo/AppDemo.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"${workspaceFolder}/AppDemo/AppDemo/AppDemo.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
]
}

@ -1,25 +0,0 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md

@ -1,25 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31911.196
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppDemo", "AppDemo\AppDemo.csproj", "{91A256A6-962E-4D61-887C-2E7BAD206002}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{91A256A6-962E-4D61-887C-2E7BAD206002}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91A256A6-962E-4D61-887C-2E7BAD206002}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91A256A6-962E-4D61-887C-2E7BAD206002}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91A256A6-962E-4D61-887C-2E7BAD206002}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {92E0A98C-A330-485F-B3CA-F3DEC02824B2}
EndGlobalSection
EndGlobal

@ -1,33 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.11.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ItemGroup>
<None Update="App.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="appsettings.Development.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

@ -1,20 +0,0 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/runtime:5.0 AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["AppDemo/AppDemo.csproj", "AppDemo/"]
RUN dotnet restore "AppDemo/AppDemo.csproj"
COPY . .
WORKDIR "/src/AppDemo"
RUN dotnet build "AppDemo.csproj" -c Release -o /app/buildQ--
FROM build AS publish
RUN dotnet publish "AppDemo.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "AppDemo.dll"]

@ -1,68 +0,0 @@
using Microsoft.Extensions.Configuration;
using System;
using System.Diagnostics;
using System.Threading;
namespace AppDemo
{
class Program
{
static void Main(string[] args)
{
var netcoreEnvironmentName = "DOTNET_ENVIRONMENT";
var environmentValue = Environment.GetEnvironmentVariable(netcoreEnvironmentName);
var builder = new ConfigurationBuilder()
.SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{environmentValue}.json", optional: true, reloadOnChange: true)
.AddEnvironmentVariables()
.AddCommandLine(args);
var configurationRoot = builder.Build();
var jsonSerializerSettings = new Newtonsoft.Json.JsonSerializerSettings()
{
Formatting = Newtonsoft.Json.Formatting.Indented,
};
while (true)
{
Console.WriteLine("当前运行环境");
Console.WriteLine($"运行模式:{(Debugger.IsAttached ? "" : "")}");
Console.WriteLine($"args参数{string.Join(",", args ?? new string[0])}");
var environmetValue = configurationRoot.GetValue<string>(netcoreEnvironmentName);
Console.WriteLine($"配置项中,{netcoreEnvironmentName}={environmetValue}");
if (args != null)
{
foreach (var arg in args)
{
Console.WriteLine($"args传参数{arg}");
if (!string.IsNullOrWhiteSpace(arg))
{
var argList = arg.Split('=');
if (argList.Length == 2)
{
Console.WriteLine($"配置管理中,{argList[0]}的值为:{configurationRoot.GetValue<string>(argList[0])}");
}
}
}
}
Console.WriteLine("---------------------------------------------------------------------");
Console.WriteLine();
//var configText = Newtonsoft.Json.JsonConvert.SerializeObject(configurationRoot.GetChildren(),jsonSerializerSettings);
//Console.WriteLine("当前配置:");
//Console.WriteLine(configText);
//Console.WriteLine("---------------------------------------------------------------------");
//Console.WriteLine();
Thread.Sleep(5000);
}
}
}
}

@ -1,13 +0,0 @@
{
"profiles": {
"AppDemo": {
"commandName": "Project",
"environmentVariables": {
"DOTNET_ENVIRONMENT": "Development"
}
},
"Docker": {
"commandName": "Docker"
}
}
}

@ -1,20 +0,0 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/runtime:5.0 AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["AppDemo/AppDemo.csproj", "AppDemo/"]
RUN dotnet restore "AppDemo/AppDemo.csproj"
COPY . .
WORKDIR "/src/AppDemo"
RUN dotnet build "AppDemo.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "AppDemo.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "AppDemo.dll"]

Before

Width:  |  Height:  |  Size: 742 KiB

After

Width:  |  Height:  |  Size: 742 KiB

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 114 KiB

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 91 KiB

@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
</configuration>

@ -1,3 +0,0 @@
{
"urls": ["https://www.baidu.com","cn.bing.com"]
}

@ -1,12 +0,0 @@
{
"NETCORE": "Development",
"urls": [ "https://www.baidu.com", "cn.bing.com" ],
"exclude": [
"**/bin",
"**/bower_components",
"**/jspm_packages",
"**/node_modules",
"**/obj",
"**/platforms"
]
}
Loading…
Cancel
Save