Skip to content

Instantly share code, notes, and snippets.

@wk-j
wk-j / MyConsole.csproj.diff
Created December 9, 2020 16:12
.NET - Show source generator output
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
+ <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
+ <CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)Generated</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
<ItemGroup>
@wk-j
wk-j / Infer.yaml
Created December 3, 2020 16:21
Leak
name: Infer
on:
push:
env:
project: MyApp
jobs:
build:
@wk-j
wk-j / Program.cs
Created December 3, 2020 16:20
Leak
using System.IO;
using System.Reflection;
GetResource1("MyApp.Program.cs");
GetResource2("MyApp.Program.cs");
ReadFile();
static string GetResource1(string path) {
var asm = Assembly.GetEntryAssembly();
var stream = asm.GetManifestResourceStream(path);
@wk-j
wk-j / response.v2.txt
Last active November 29, 2020 07:15
499
http http: //localhost/hello/v2/2
HTTP/1.1 200 OK
Content-Length: 5
Content-Type: text/plain; charset=utf-8
Date: Sun,
29 Nov 2020 07: 15: 01 GMT
Server: Kestrel
Hello
@wk-j
wk-j / ocelot.v2.json
Last active November 29, 2020 07:11
499
{
"Routes": [
{
"DownstreamPathTemplate": "/api/hello/hi/{delay}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "web",
"Port": 80
}
@wk-j
wk-j / response.2m.txt
Last active November 29, 2020 06:53
499
http http://localhost/hello/v1/2
HTTP/1.1 499
Content-Length: 0
Date: Sun, 29 Nov 2020 06:51:47 GMT
Server: Kestrel
@wk-j
wk-j / response.1m.txt
Last active November 29, 2020 06:50
499
http http://localhost/hello/v1/1
HTTP/1.1 200 OK
Content-Length: 5
Content-Type: text/plain; charset=utf-8
Date: Sun, 29 Nov 2020 06:49:04 GMT
Server: Kestrel
Hello
{
"Routes": [
{
"DownstreamPathTemplate": "/api/hello/hi/{delay}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "web",
"Port": 80
}
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace MyWeb.Controllers.Hello {
[ApiController]
[Route("api/[controller]/[action]")]
public class HelloController : ControllerBase {
private readonly ILogger<HelloController> _logger;
@wk-j
wk-j / success.txt
Last active November 26, 2020 21:10
Self contained
❯❯❯ dotnet build src/MyWindowsWeb -r win7-x64 -f netcoreapp2.1 /p:TargetLatestRuntimePatch=true
Microsoft (R) Build Engine version 16.8.0+126527ff1 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date for restore.
MyWeb -> /Users/wk/Source/net-sdk-1061/src/MyWeb/bin/Debug/netcoreapp2.1/MyWeb.dll
MyWindowsWeb -> /Users/wk/Source/net-sdk-1061/src/MyWindowsWeb/bin/Debug/netcoreapp2.1/win7-x64/MyWindowsWeb.dll