1,命令jquery
2,模板linux
3,更換啓動瀏覽器git
4,vscode使用nugetgithub
6,配置.net core的工做目錄chrome
9,vscode使用Bowerbootstrap
10,引用項目 windows
dotnet new --help 查詢命令幫助
D:\github\test2>dotnet run 啓動web程序
dotnet build 編譯代碼
dotnet restore 還原包
dotnet publish 發佈項目
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using test3.Models; namespace test3.Controllers { public class HomeController : Controller { public IActionResult Index() { return View(); } public IActionResult About() { ViewData["Message"] = "Your application description page."; return View(); } public IActionResult Contact() { ViewData["Message"] = "Your contact page."; return View(); } public IActionResult Error() { return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); } } }
windows下啓動瀏覽器命令: C:\Windows\System32>cmd.exe /C start http://localhost:5000/api/values
"launchBrowser": { "enabled": true, "args": "${auto-detect-url}", "windows": { "command": "C:\\Users\\Hunter\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe", "args": "${auto-detect-url}" }, "osx": { "command": "open" }, "linux": { "command": "xdg-open" } },
①安裝nuget
② ctrl + shift +P 選擇nuget,而後輸入包名稱回車下載
③包版本變動
打開.csproj文件,直接更改PackageReference下的Version
而後dotnet restore
dotnet ef migrations add initialCreate Add-Migration【添加更新實體】
dotnet ef database update Update-Database【向數據庫更新】
dotnet ef migrations remove Remove-Migration【刪除最後一個migration文件,前提是該migration文件爲update到數據庫】
dotnet ef database update LastGoodMigration Update-Database LastGoodMigration【回滾到指定的migration文件。不會刪除migration文件。若是不須要migration文件能夠經過dotnet ef migrations remove刪除掉】
dotnet ef migrations script Script-Migration【打印出數據庫變動腳本】
須要在工程文件中加入
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.2"/> 和 <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.2"/>
dotnet ef migrations add init -o Data/Migrations
之後再添加不用使用 -o Data/Migrations 直接會添加在Data/Migrations文件夾下
①vscode安裝Bower擴展
Ctrl + Shift + p 就能夠使用Bower了
②在項目中添加.bowerrc文件指定包安裝路徑
{ "directory": "wwwroot/lib" }
③添加bower.json文件
{ "name": "MvcDemo2", "private": true, "dependencies": { "jquery": "3.1.1", "bootstrap": "3.3.7", "zTree":"3.5.33" } }