-
Notifications
You must be signed in to change notification settings - Fork 59
/
csharp-net.txt
197 lines (149 loc) · 10.1 KB
/
csharp-net.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
CENTOS
https://docs.microsoft.com/zh-cn/dotnet/core/install/linux-centos
https://docs.microsoft.com/zh-cn/dotnet/core/tools/dotnet-publish
https://docs.microsoft.com/zh-cn/dotnet/standard/frameworks
https://docs.microsoft.com/zh-cn/dotnet/core/tools/dotnet
https://dotnet.microsoft.com/download/dotnet-core
https://dotnet.microsoft.com/download/dotnet/5.0
rpm -Uvh https://packages.microsoft.com/config/centos/8/packages-microsoft-prod.rpm
rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm
yum search dotnet-sdk
dotnet-sdk-2.2
dotnet-sdk-3.0
dotnet-sdk-3.1
dotnet-sdk-5.0
yum install dotnet-sdk-5.0 -y
dnf install dotnet-sdk-5.0
dotnet --info
dnf install aspnetcore-runtime-5.0
dnf install dotnet-runtime-5.0
dotnet new -l
console winforms web mvc webapp webapi react webconfig sln
mkdir test && cd test
dotnet new webapi
dotnet publish -c Release -f net5.0 -o bin/Release/net5.0/v1 -r linux-x64
dotnet publish -c Release -r linux-x64 --no-self-contained ./test.csproj
dotnet publish -c Release -r osx-x64 -p:PublishReadyToRun=true -p:PublishSingleFile=true
dotnet publish -c Release -r win-x64 -p:PublishReadyToRun=true
dotnet publish -c Release -f netcoreapp3.1
dotnet publish -c Release -f net48
dotnet publish --configuration Release
dotnet bin/Release/net5.0/publish/test.dll
mkdir apptest1 && cd apptest1
dotnet new console -lang "C#"
dotnet add package Figgle
Console.WriteLine(Figgle.FiggleFonts.Standard.Render("Hello, World!"));
dotnet run
dotnet restore
dotnet new classlib -lang C# -o MyLibrary
dotnet new sln
dotnet sln add apptest1.csproj
dotnet sln add MyLibrary/MyLibrary.csproj
dotnet sln list
dotnet sln apptest1.sln list
dotnet sln remove MyLibrary/MyLibrary.csproj
dotnet sln todo.sln add **/*.csproj
dotnet build -c Release
dotnet clean -c Release
dotnet msbuild -property:Configuration=Release
dotnet add reference lib1/lib1.csproj lib2/lib2.csproj
dotnet add app/app.csproj reference lib/lib.csproj
dotnet add app/app.csproj reference **/*.csproj
dotnet list app/app.csproj reference
dotnet list reference
dotnet list package
dotnet add package Newtonsoft.Json
dotnet add ToDo.csproj package Microsoft.Azure.DocumentDB.Core -v 1.0.0
dotnet --list-runtimes
dotnet --list-sdks
Install-Package BeetleX -Version 1.6.3
dotnet add package BeetleX --version 1.6.3
<PackageReference Include="BeetleX" Version="1.6.3" />
paket add BeetleX --version 1.6.3
Install-Package BeetleX.Redis -Version 1.0.1
dotnet add package BeetleX.Redis --version 1.0.1
<PackageReference Include="BeetleX.Redis" Version="1.0.1" />
paket add BeetleX.Redis --version 1.0.1
%Msbuild% /ds /clp:ShowTimestamp;Summary /m %sln% /t:Clean;Build /p:OutDir=%OutDir%,DebugSymbols=True
rem windows远程复制
set ip_addr=172.16.10.108
rem 连接到远程服务器172.16.10.108
net use \\%ip_addr%\c$ password /user:administrator
rem 更新复制到远程服务器C盘test目录下
xcopy D:\computer\system\win_server\*.exe \\%ip_addr%\c$\test /D /E /Y /H /K
rem 复制并创建文件夹(如果文件夹不存在将会创建文件夹,使用/I参数时,如果share下面有多文件,则默认share为文件夹)
xcopy D:\computer\system\win_server\share \\%ip_addr%\c$\test\share /D /E /Y /H /K /I
rem 04-20-2015之后的文件全部复制(即使目标文件较新,也会被覆盖)
xcopy D:\computer\system\win_server\share \\%ip_addr%\c$\test\share /D:04-20-2015 /E /Y /H /K
copy /y zipFileName \\%ip_addr%\c$\iisweb\copyFolder\ylxt.zip
rem 删除连接
net use \\%ip_addr%\c$ /delete
pause
C:\Windows\Microsoft.NET\Framework\v3.5\Msbuild.exe F:\download\MSBuildDemo1\MSBuildDemo.sln /t:Clean;Build /p:OutDir=H:\testweb\
C:\Windows\Microsoft.NET\Framework\v3.5\Msbuild.exe F:\download\MSBuildDemo\BFL.MSBuildDemo.WebApp\BFL.MSBuildDemo.WebApp.csproj /t:Clean;Build;_CopyWebApplication /p:OutDir=H:\testweb\
不用 PublishProfile
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\msbuild.exe" ./WebApi.csproj /p:Configuration=Release /p:DeployOnBuild=true /p:DeployTarget=MsDeployPublish /p:MsDeployServiceUrl=192.168.xxx.xxx /p:AllowUntrustedCertificate=True /p:MSDeployPublishMethod=WMSvc /p:UserName="xxxxx" /p:Password="xxxxx" /p:DeployIISAppPath="xxxxx" /p:VisualStudioVersion=16.0
用 PublishProfile
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\msbuild.exe" ./WebApi.csproj /p:Configuration=Release /p:CreatePackageOnPublish=True /p:DeployOnBuild=true /p:PublishProfile=./Properties/PublishProfiles/FolderProfile.pubxml /p:VisualStudioVersion=16.0 /p:Password="xxxxx"
msbuild AspNetRazor3WebSite\website.publishproj /p:PublishUrl="bin\Release\PublishOutput" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="."
msbuild AspNetRazor3WebSite\website.publishproj /p:PackageLocation="bin\Release\PublishOutputZip" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=Package /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:PackageAsSingleFile=true /p:DeployIisAppPath="Default Web Site" /p:SolutionDir="."
msbuild .\WebService\website.publishproj /p:DeployOnBuild=true /p:OutputPath=c:\out\ /p:Configuration=Release /p:AutoParameterizationWebConfigConnectionStrings=False
@echo off
cd C:\Develop\Traingo.LMS\Traingo.LMS.StudyWebV2 & C:
rd /s /q ..\..\publish\WebSite\demo\StudyWebV2\
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" .\website.publishproj /t:Rebuild /p:DeployOnBuild=true /p:Configuration=Release /P:_PackageTempDir="..\..\publish\WebSite\demo\StudyWebV2" /p:CreatePackageOnPublish=True /p:PublishProfile=".\App_Data\PublishProfiles\StudyWebV2.pubxml" /p:SolutionDir="."
cd "%~dp0" & %~d0
pause
你NuGet.exe的恢复你的包。运行的每个项目。
nuget install packages.config
或用NuGet的2.7可以恢复所有包中的行。
nuget restore YourSolution.sln
PM> Install-Package NuGetPowerTools
PM> Enable-PackageRestore
Update-Package -Reinstall
Update-Package -ProjectName 'YourProjectNameGoesHere' -Reinstall
dotnet restore test.csproj
nuget restore
:: =========== Solution ===============
msbuild ASPNetPublishSamples.sln /p:PublishUrl="bin\Release\PublishOutput" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="."
:: =========== WebSite ===============
REM ASP.NET Razor 3 Web Site.
msbuild AspNetRazor3WebSite\website.publishproj /p:PublishUrl="bin\Release\PublishOutput" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=FileSystem /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:SolutionDir="."
:: =========== Solution ===============
msbuild ASPNetPublishSamples.sln /p:PackageLocation="bin\Release\PublishOutputZip" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=Package /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:PackageAsSingleFile=true /p:DeployIisAppPath="Default Web Site" /p:SolutionDir="." /p:DesktopBuildPackageLocation="PublishOutputZip\MsDeployPackage.zip"
:: =========== WebSite ===============
REM ASP.NET Razor 3 Web Site.
msbuild AspNetRazor3WebSite\website.publishproj /p:PackageLocation="bin\Release\PublishOutputZip" /p:DeployOnBuild=true /p:Configuration=Release /p:WebPublishMethod=Package /p:DeployTarget=WebPublish /p:AutoParameterizationWebConfigConnectionStrings=false /p:PackageAsSingleFile=true /p:DeployIisAppPath="Default Web Site" /p:SolutionDir="."
必备
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL
dotnet add package Dapper
dotnet add package MySql.EntityFrameworkCore
dotnet add package MySqlConnector
dotnet add package Microsoft.EntityFrameworkCore.Tools
dotnet add package NPOI
dotnet add package StackExchange.Redis
dotnet add package MySql.Data.EntityFrameworkCore
dotnet add package Pomelo.EntityFrameworkCore.MySql
dotnet tool install -g dotnet-ef
dotnet tool install --global dotnet-ef
dotnet ef dbcontext scaffold "server=127.0.0.1;userid=root;pwd=123456;port=3306;database=etms;sslmode=none;" MySql.EntityFrameworkCore -o Models -f
dotnet ef dbcontext scaffold "server=127.0.0.1;userid=root;pwd=123456;port=3306;database=etms;sslmode=none;" MySql.EntityFrameworkCore -o Models -t users -n net5 -c EFContext -f --no-onconfiguring
dotnet ef dbcontext scaffold "Server=127.0.0.1;Database=etms;User Id=root;Password=123456;" Npgsql.EntityFrameworkCore.PostgreSQL -o Models -t users -n net5 -c EFContext -f --no-onconfiguring
dotnet ef dbcontext scaffold "Server=127.0.0.1;Database=test2;User Id=TraingoSaDb;Password=123456;encrypt=disable;" Microsoft.EntityFrameworkCore.SqlServer -o Models -t users -n net5 -c EFContext -f --no-onconfiguring
或者
Scaffold-DbContext "server=localhost;userid=root;pwd=123456;port=3306;database=ame_data;sslmode=none;" Pomelo.EntityFrameworkCore.MySql -OutputDir Models -UseDatabaseNames -Force
Scaffold-DbContext "Data Source=127.0.0.1;Initial Catalog=CoreTest;User=sa;Password=lxy.1998" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
dotnet ef migrations add CreateSchoolDB <- just a label
dotnet ef migrations list <- to verify it is pending
dotnet ef database update <- the database will be created/updated
dotnet ef migrations list <- to verify
借助量子力学的思想,从单个示例生成位图和瓷砖图
https://github.com/mxgmn/WaveFunctionCollapse
基于模式匹配和约束传播的概率语言,153 个例子
https://github.com/mxgmn/MarkovJunior
winsw
https://github.com/winsw/winsw
DevToys 有助于完成日常任务,例如格式化 JSON、比较文本、测试 RegExp。无需使用许多不真实的网站来处理您的数据的简单任务。借助智能检测,DevToys 能够检测出可以处理您在 Windows 剪贴板中复制的数据的最佳工具。紧凑的覆盖可让您将应用程序保持在较小的位置并位于其他窗口的顶部。可以一次使用应用程序的多个实例。
https://github.com/veler/DevToys
https://github.com/ObuchiYuki/DevToysMac