Skip to content

Instantly share code, notes, and snippets.

View javiercn's full-sized avatar

Javier Calvarro Nelson javiercn

View GitHub Profile
@javiercn
javiercn / Instructions.md
Last active March 11, 2020 09:16
Cleanup dotnet machine state

Clear nuget cache

dotnet nuget locals --clear all: This will remove ALL packages in your nuget cache from your machine, as a result other projects might fail to restore afterwards if the package is not available in the original download location

Clear dotnet engine template cache

rm -rf ~/.templateengine: This will remove all templates you installed that didn't come with the SDK

Clear dotnet profile state

rm -rf ~/.dotnet: This will remove all files dotnet creates during the first run experience, tools installs, etc.

@javiercn
javiercn / DevelopmentSandbox.wsb
Last active May 10, 2023 01:09
Developer-sandbox
<Configuration>
<MappedFolders>
<MappedFolder>
<HostFolder>C:\work\WindowsSandbox\DevelopmentSandboxShare</HostFolder>
<ReadOnly>true</ReadOnly>
</MappedFolder>
</MappedFolders>
<LogonCommand>
<Command>powershell -noexit -executionpolicy bypass -File C:\Users\WDAGUtilityAccount\Desktop\DevelopmentSandboxShare\DeveloperSandboxSetup.ps1</Command>
</LogonCommand>
@javiercn
javiercn / Debug-Browser-Logs.html
Last active November 6, 2019 14:25
Customers-Blazor-Debug
<script src="_framework/blazor.server.js" autostart="false"></script>
<script>
(function start() {
Blazor.start({
logLevel: 1, // LogLevel.Debug
configureSignalR: builder => builder.configureLogging("debug") // LogLevel.Debug
});
})()
</script>
@javiercn
javiercn / Debug-Build-Hangs.md
Created September 23, 2019 12:32
Debugging build hangs

Build hang post-mortem analysis

Over the past few weeks we've added the ability to capture process dumps to the build. (Currently for Windows Test and Windows Templates Test).

When a build hangs on the CI, a process dump is captured for currently running processes. (we capture dumps for dotnet processes, but can be easily expanded to other processes)

These dumps are available as artifacts under Artifacts -> Windows_Test_Dumps and Artifacts -> Windows_Templates_Test_Dumps respectively.

Build hang debug example

@javiercn
javiercn / static-web-assets.md
Last active September 16, 2019 15:55
List static web assets
([xml] (Get-Content .\bin\*\*\*.StaticWebAssets.xml)) | 
Select-Object -ExpandProperty StaticWebAssets |
Select-Object -ExpandProperty ContentRoot |
ForEach-Object { 
  $tmpRoot = $_.Path;
  $tmpBase = $_.BasePath;
  Push-Location $tmpRoot;
  Get-ChildItem -Recurse -File $tmpRoot |
 Select-Object -ExpandProperty FullName |
@javiercn
javiercn / AspNetCore.wprp
Last active September 12, 2019 17:35
Logging options for capturing ASP.NET Core logs as ETW events
<?xml version="1.0" encoding="utf-8" standalone='yes'?>
<WindowsPerformanceRecorder Version="1.0">
<Profiles>
<EventCollector
Id="AspNetCoreEventCollector"
Name="ASP.NET Core Event Collector">
<BufferSize Value="4096"/>
@javiercn
javiercn / Turn-on-app-insights.md
Created August 20, 2019 16:51
Cheatsheets - A list of varied cheatsheets to accomplish common ASP.NET Core tasks
  • Add Microsoft.ApplicationInsights.AspNetCore to the list of packages.
  • Add the application insights logger to Program.cs
Host.CreateDefaultBuilder(args)
    .ConfigureLogging(l =>
    {
        l.AddApplicationInsights();
    })
    .ConfigureWebHostDefaults(webBuilder =>
 {
/Platform_Assemblies_Paths
"C:\work\OptimizedAntaresCache\1.0.3\build\TempRestorePackages\Microsoft.CodeAnalysis.CSharp\1.3.0\lib\netstandard1.3;C:\work\OptimizedAntaresCache\1.0.3\build\TempRestorePackages\Microsoft.CodeAnalysis.Common\1.3.0\lib\netstandard1.3;C:\work\OptimizedAntaresCache\1.0.3\build\TempRestorePackages\System.AppContext\4.1.0\lib\netstandard1.6;C:\work\OptimizedAntaresCache\1.0.3\build\TempRestorePackages\runtime.any.System.Runtime\4.1.0\lib\netstandard1.5;C:\work\OptimizedAntaresCache\1.0.3\build\TempRestorePackages\runtime.win7.System.Private.Uri\4.0.1\runtimes\win\lib\netstandard1.0;C:\work\OptimizedAntaresCache\1.0.3\build\TempRestorePackages\runtime.any.System.Collections\4.0.11\lib\netstandard1.3;C:\work\OptimizedAntaresCache\1.0.3\build\TempRestorePackages\System.Collections.Concurrent\4.0.12\lib\netstandard1.3;C:\work\OptimizedAntaresCache\1.0.3\build\TempRestorePackages\runtime.win.System.Diagnostics.Debug\4.0.11\runtimes\win\lib\netstandard1.3;C:\work\OptimizedAntaresCache\1.0.3\