Skip to content

Instantly share code, notes, and snippets.

@aswad32
Last active March 4, 2017 16:50
Show Gist options
  • Save aswad32/10b79cc645879dcdf42089b540e3f14a to your computer and use it in GitHub Desktop.
Save aswad32/10b79cc645879dcdf42089b540e3f14a to your computer and use it in GitHub Desktop.
#Project Structure
MyCode
--MyCode.sln
--src
--MyCode.Common
--MyCode.WebApi
#Create Main Solution
> dotnet new sln --name MyCode
#Create Class Library Project
> dotnet new classlib --name MyCode.Common --framework netcoreapp1.1
#Create WebApi Project
> dotnet new webapi --name MyCode.WebApi --framework netcoreapp1.1
#Add Project to Solution (inside root directory)
> dotnet sln MyCode.sln add ./src/MyCode.Common/MyCode.Common.csproj
> dotnet sln MyCode.sln add ./src/MyCode.WebApi/MyCode.WebApi.csproj
#Add References from one project to another
#Change directory to source where you want to add references to (in this case MyCode.WebApi)
> dotnet add reference ../MyCode.Common/MyCode.Common.csproj
#Build Project (inside root directory if want to build all project)
> dotnet build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment