Skip to content

Instantly share code, notes, and snippets.

View spottedmahn's full-sized avatar

Michael DePouw spottedmahn

View GitHub Profile
@spottedmahn
spottedmahn / Debugging ASP.NET Core Routing.cs
Last active September 2, 2018 19:35
Some code to see what ASP.NET Core sees for routes and actions
using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Infrastructure;
public SomeController(
IActionDescriptorCollectionProvider actionDescriptorCollectionProvider,
ApplicationPartManager applicationPartManager)
{ }
[Route("routes")]
@spottedmahn
spottedmahn / restart-for-iis-express.ps1
Created October 23, 2022 14:28
Error on debug / startup w/ IIS Express | port in use or something
#https://stackoverflow.com/a/66290952/185123
net stop winnat; net start winnat
@spottedmahn
spottedmahn / restart-iis-modern-way.ps1
Last active October 23, 2022 14:30
After changing ASP.NET ENV variable, need to restart IIS and IISReset doesn't work apparently
#https://github.com/aspnet/IISIntegration/issues/1401#issuecomment-423252335
net stop /y was && net start w3svc
@spottedmahn
spottedmahn / self-signed-cert.ps1
Last active October 23, 2022 14:30
Self Signed Cert Windows via PowerShell
$ExpirationDate = (Get-Date).AddYears(20)
New-SelfSignedCertificate -dnsname localhost -subject "CN=BlahApp" -CertStoreLocation "Cert:\LocalMachine\My" -FriendlyName "Blah Local Development Certificate" -NotAfter $ExpirationDate