start
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| start [2019/09/22 22:24] – stephen | start [2026/04/13 01:37] (current) – stephen | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| This is a collection of random stuff I want to record for future reference. Probably not much use to anyone else. | This is a collection of random stuff I want to record for future reference. Probably not much use to anyone else. | ||
| + | |||
| + | ====== Libyear ====== | ||
| + | |||
| + | <code powershell> | ||
| + | # .NET | ||
| + | dotnet tool install -g libyear | ||
| + | libyear | ||
| + | |||
| + | # NPM??? | ||
| + | </ | ||
| + | |||
| + | ===== Command Line Code Coverage ===== | ||
| + | |||
| + | <code powershell> | ||
| + | ### Setup | ||
| + | |||
| + | # Install ReportGenerator globally (one-time) | ||
| + | dotnet tool install -g dotnet-reportgenerator-globaltool | ||
| + | |||
| + | # Set up variables. Ensure your current directory is the repo root. | ||
| + | $projectName = " | ||
| + | $projectProj = " | ||
| + | $testResults = " | ||
| + | |||
| + | ### Generate Code Coverage | ||
| + | |||
| + | # All tests | ||
| + | dotnet test --project $projectProj --coverage --coverage-output " | ||
| + | |||
| + | # A specific class | ||
| + | dotnet test --project $projectProj --filter-class " | ||
| + | |||
| + | ### View Coverage | ||
| + | |||
| + | # Generate an HTML report from the Cobertura XML file | ||
| + | reportgenerator -reports:" | ||
| + | |||
| + | # Open the report | ||
| + | Start-Process " | ||
| + | </ | ||
| + | |||
| + | ===== .NET Logging Levels ===== | ||
| + | |||
| + | Trace = 0, Debug = 1, Information = 2, Warning = 3, Error = 4, Critical = 5, and None = 6. | ||
| + | |||
| + | ===== Running with Rubix ===== | ||
| + | |||
| + | Rubix and I did approximately 1,547 runs and covered 16,347kms together. First run was 2015-08-24, last was around 2024-07-24. | ||
| + | |||
| + | ===== Restart Garmin Forerunner 235 ===== | ||
| + | |||
| + | Hold down the ☀️ button for ages. Watch will power off. Press it again to power on. Settings etc. are not lost. | ||
| + | |||
| + | ===== Set Environment Variable in Unit Test ===== | ||
| + | |||
| + | Create a '' | ||
| + | |||
| + | <code xml> | ||
| + | <?xml version=" | ||
| + | <!-- File name extension must be .runsettings --> | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | <!-- List of environment variables we want to set--> | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | Getting Visual Studio to use the file is a bit tricky. Try Test -> Configure Test Settings. You may need the ' | ||
| + | |||
| + | To test, debug and stop at a breakpoint. Run '' | ||
| + | |||
| + | ===== Direct Object Creation with Ninject ===== | ||
| + | |||
| + | This will only work inside an ASP.NET project. | ||
| + | |||
| + | <code c#> | ||
| + | using System.Web.Mvc; | ||
| + | |||
| + | private ILog _log; | ||
| + | private ILog Log => _log ?? (_log = (ILog)DependencyResolver.Current.GetService(typeof(ILog))); | ||
| + | </ | ||
| + | |||
| + | ===== Azure Virtual Machine Windows Activation Problems ===== | ||
| + | |||
| + | Running this worked on my Azure Dev VM: | ||
| + | |||
| + | <code powershell> | ||
| + | ForEach-Object { Invoke-Expression " | ||
| + | </ | ||
| + | |||
| + | More details at [[https:// | ||
| + | |||
| + | ===== Log all TypeScript functions ===== | ||
| + | |||
| + | Search: ''< | ||
| + | |||
| + | Replace: ''< | ||
| + | |||
| + | ===== Stupid Roslyn Error ===== | ||
| + | |||
| + | < | ||
| + | Could not find a part of the path ' | ||
| + | </ | ||
| + | |||
| + | Run this in the Package Manager Console: | ||
| + | < | ||
| + | Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -r | ||
| + | </ | ||
| ===== Use PowerShellGet behind a corporate proxy ===== | ===== Use PowerShellGet behind a corporate proxy ===== | ||
start.1569191077.txt.gz · Last modified: 2019/09/23 23:24 (external edit)
