Skip to content

Instantly share code, notes, and snippets.

@haruair
Last active October 19, 2017 23:44
Show Gist options
  • Save haruair/5a6e43fd6ca1da5ed9a8d51e7b400835 to your computer and use it in GitHub Desktop.
Save haruair/5a6e43fd6ca1da5ed9a8d51e7b400835 to your computer and use it in GitHub Desktop.
dotnet core project
mkdir helloworld && cd helloworld
echo "# HelloWorld" > README.md
dotnet new sln -n HelloWorld
mkdir src test
dotnet new angular --output src/HelloWorld.WebApp --name HelloWorld.WebApp
dotnet new xunit --output test/HelloWorld.WebApp.Tests --name HelloWorld.WebApp.Tests
cd test/HelloWorld.WebApp.Tests
dotnet add reference ../../src/HelloWorld.WebApp/HelloWorld.WebApp.csproj
cd ../..
# the namespace is something weird
# `.` is converted to underscore so manually fix it for the time being
find src -type f -name "*.cs*" -exec sed -i '' 's/HelloWorld_WebApp/HelloWorld.WebApp/g' {} +
dotnet sln add src/HelloWorld.WebApp/HelloWorld.WebApp.csproj
dotnet sln add test/HelloWorld.WebApp.Tests/HelloWorld.WebApp.Tests.csproj
cd src/HelloWorld.WebApp
dotnet restore
npm install
dotnet run
@haruair
Copy link
Author

haruair commented Oct 19, 2017

Note...

mkdir haruair-simple && cd haruair-simple
echo "# Haruair" > README.md

dotnet new sln -n HaruairSimple
mkdir src test

dotnet new reactredux --output src/HaruairSimple.WebApp --name HaruairSimple.WebApp
dotnet new classlib --output src/HaruairSimple --name HaruairSimple
dotnet new xunit --output test/HaruairSimple.WebApp.Tests --name HaruairSimple.WebApp.Tests

cd src/HaruairSimple.WebApp
dotnet add reference ../../src/HaruairSimple/HaruairSimple.csproj
cd ../..

cd test/HaruairSimple.WebApp.Tests
dotnet add reference ../../src/HaruairSimple.WebApp/HaruairSimple.WebApp.csproj
cd ../..

# the namespace is something weird
# `.` is converted to underscore so manually fix it for the time being
find src -type f -name "*.cs*" -exec sed -i '' 's/HaruairSimple_WebApp/HaruairSimple.WebApp/g' {} +

dotnet sln add src/HaruairSimple.WebApp/HaruairSimple.WebApp.csproj
dotnet sln add src/HaruairSimple/HaruairSimple.csproj
dotnet sln add test/HaruairSimple.WebApp.Tests/HaruairSimple.WebApp.Tests.csproj
cd src/HaruairSimple.WebApp
dotnet restore
npm install
dotnet run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment