Skip to content

Instantly share code, notes, and snippets.

@brianmed
Last active September 5, 2021 02:54
Show Gist options
  • Save brianmed/17202c2be99585ab138a41334207d027 to your computer and use it in GitHub Desktop.
Save brianmed/17202c2be99585ab138a41334207d027 to your computer and use it in GitHub Desktop.
ASP.Net MVC Core 5 Remote Run with Local File Editing
#!/bin/bash
# PATH=$PATH:. DOTNET_WATCH_SUPPRESS_MSBUILD_INCREMENTALISM=1 DOTNET_WATCH_SUPPRESS_LAUNCH_BROWSER=1 DOTNET_WATCH_SUPPRESS_BROWSER_REFRESH=1 DOTNET_USE_POLLING_FILE_WATCHER=1 dotnet watch --verbose remoteRun
set -e
# Because the text goes crazy when the watcher detects a change
stty sane
# publish so we get wwwroot
dotnet publish -r linux-x64 --configuration Debug
# File magic
rsync -azPv --stats --progress --delete-after bin/Debug/net5.0/linux-x64/publish/ [email protected]:AppName/
# For context
date
# Command Magic
ssh -t [email protected] sh -c \'cd AppName \&\& ASPNETCORE_ENVIRONMENT=Development dotnet ./AppName.Server.dll --urls="http://*:5000"\'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment