how to create .netcore project
1. Install Visual Studio Code
2. Install the .NET Core SDK
3 create the project
mkdir TodoApi
cd TodoApi
dotnet new webapi -o APILayer
dotnet new mvc -o HumanKode.Web
dotnet new classlib -o HumanKode.Extensions
7 add solution
dotnet new sln -n Demo not need -o means not in it's own direction
dotnet sln [solutionName] add **/*.csproj
dotnet restore
code .
4 install c# extension
within vs code explorer .open startup.cs .you will be prompted to install it .click show recommendations and then click install.
click reload .After reloading .VS code will begin updating c# dependencies.
once complete.you will be prompted to add missing assets and debug the project .click Yes
5 debug it
you can launch the projiect by pressing F5,and navigate to and navigate to http://localhost:5000/api/values
6 add multiple project is
to project folder .then run cd HumanKode.Web
dotnet add reference ../HumanKode.Extensions/HumanKode.Extensions.csproj command
8 add packages
dotnet add package MogoDB.Driver
7 use git
sudo apt-get install git
git config --global user.name 'seawavezhangdining'
git config --global user.email 'seawave.zhangdining@gmail.com'
ssh-keygen -t rsa -C "your@email.com" then will generate key in hidden fold called .ssh
then add pub key to github website --setting
ssh -T git@github.com this command make local machine and remote build relationship.
in some project folder .
git init this set this folder as local repository
git remote add name(remote name,can give it some name) url(https://github.com/username/repositoryname.git)
this bind local repository wih remote repository.
git config --global credential.helper store this set credential helper to store
git config --global credential.helper this command is verifu credential
git add .(xxx)
git commit -m 'commit description'
git pull remotename(above command named ) branchname(master)
8 webapi debug with third extensions
-- if suddenly network dispear. then to do this.
sudo service network-manager stop
sudo rm /var/lib/NetworkManager/NetworkManager.state
sudo service network-manager start
*******************webapi
***************** websocket****************************
posted on 2020-03-26 09:36 developer1980 阅读(89) 评论(0) 收藏 举报
浙公网安备 33010602011771号