Skip to content

Instantly share code, notes, and snippets.

@karenpayneoregon
karenpayneoregon / someprojectfile.csproj
Last active February 7, 2024 19:33
reduced source path
<PropertyGroup>
<PathMap>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)'))=./</PathMap>
</PropertyGroup>
@sharwell
sharwell / !ErrorReporting.md
Last active April 23, 2020 18:38
Windows Error Reporting

Capturing heap dumps for investigating crashes

The following commands demonstrate a registry configuration that collects local heap dumps when a process crashes. Software developers can add these keys for processes they work on to help provide actionable data in the event of a crash during use.

Each command in the samples places the captured heap dumps in a folder C:\CrashDumps. The command can be modified before execution to use a different location.

🔗 Collecting User-Mode Dumps (Windows Dev Center)

@KirillOsenkov
KirillOsenkov / Directory.Build.props
Created April 12, 2019 16:56
SDK-style Directory.Build.props for common output directory
<Project>
<PropertyGroup>
<SrcRoot>$(MSBuildThisFileDirectory)</SrcRoot>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(SrcRoot)\</SolutionDir>
<Configuration Condition="$(Configuration) == ''">Debug</Configuration>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
@lhorie
lhorie / longest-keyword-sequence.md
Last active November 14, 2022 23:21
What's the longest keyword sequence in Javascript?
@davidfowl
davidfowl / dotnetlayout.md
Last active May 15, 2024 07:06
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@controlflow
controlflow / gist:9996185
Last active January 10, 2018 08:17
C# 6.0 null-safe member access/method/indexer call use cases
nullness inspection
{
a?.M();
a.F(); // <= possible NRE
a?.M(a != null); // <= expression always true
}
inspection "Redundant null-propagation"
{
var a = new A();
@controlflow
controlflow / gist:8072635
Last active January 1, 2016 01:28
Primary ctors
class ReverseForLookupItem : ForLookupItemBase
{
public ReverseForLookupItem([NotNull] PrefixExpressionContext context,
[NotNull] LiveTemplatesManager templatesManager,
[CanBeNull] string lengthPropertyName)
: base("forR", context, templatesManager, lengthPropertyName) { }
protected override IForStatement CreateStatement(CSharpElementFactory factory, ICSharpExpression expression)
{
...