Skip to content

Instantly share code, notes, and snippets.

View shirhatti's full-sized avatar

Sourabh Shirhatti shirhatti

View GitHub Profile
@shirhatti
shirhatti / Errors.md
Last active April 27, 2016 21:19
ANCM Error

ANCM Errors

Happy path

Event Logs

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="IIS AspNetCore Module" />
    <EventID Qualifiers="0">1001</EventID>
@shirhatti
shirhatti / Startup.cs
Created August 3, 2016 01:06
Minimal ASP.NET Core to return 404
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
namespace ConsoleApplication
{
public class Startup
{
public void Configure(IApplicationBuilder app) {
app.Run(async (context) =>
@shirhatti
shirhatti / connectionclose
Created August 16, 2016 19:51
ANCM returns 200 when framework throws exceptions
.
@shirhatti
shirhatti / boxstarter.ps1
Last active August 15, 2019 23:08 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Sourabh Shirhatti <[email protected]>
# Last Updated: 2017-12-21
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@shirhatti
shirhatti / web.config
Created February 27, 2018 21:35
ANCM inprocess
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\MyWebApp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</configuration>
@shirhatti
shirhatti / ancm.ps1
Last active March 1, 2018 01:44
Install ANCM
Invoke-WebRequest -Uri https://raw.githubusercontent.com/shirhatti/ANCM-ARMTemplate/b13de5f65b8c524d9ce72da5fd8df774e0eb76da/install-ancm.ps1 -OutFile install-ancm.ps1
.\install-ancm.ps1
@shirhatti
shirhatti / config.xml
Created February 27, 2018 22:55
Csproj snippet
<PropertyGroup>
<AspNetCoreModuleHostingModel>inprocess</AspNetCoreModuleHostingModel>
</PropertyGroup>
@shirhatti
shirhatti / config.xml
Created February 27, 2018 22:58
pubxml snippet
<PropertyGroup>
<AllowUntrustedCertificate>True</AllowUntrustedCertificate>
</PropertyGroup>
app.Run(async (context) =>
{
var processName = Process.GetCurrentProcess().ProcessName;
await context.Response.WriteAsync($"Hello World from {processName}");
});
@shirhatti
shirhatti / ancminstall.ps1
Created December 7, 2018 02:13
Powershell script to work around shared config block in ANCM
Import-Module IISAdministration
# Stop WAS/W3SVC
Stop-Service -Name WAS -Force
# Disable shared config
$sm = Get-IISServerManager
$sm.GetRedirectionConfiguration().GetSection("configurationRedirection").Attributes["enabled"].Value = $false
$sm.CommitChanges()