Archive
-
The Full Picture — Was the Machinery Worth Owning?
Eighteen months later: did the one-field change actually get cheaper? What the machinery was worth owning, which lessons transfer, and where I would not build this again.
Nuxt in Production -
Load Testing an SSR Migration — Making the Numbers Comparable
Comparing an SSR migration with the stack it replaced, when the two were measured by different tools at different boundaries. Defining the statistic before claiming an improvement.
Nuxt in Production -
From a Latency Alert to a Root Cause — Traces, Logs, and Metrics in Practice
From a latency alert to a root cause with traces, logs and metrics: which component produces which signal, what each one proves, and why a correlation ID is not a trace ID.
Nuxt in Production -
Memory, Stability, and PM2 — Why a Heap Limit Did Not Prevent the Restart
A container killed for memory while the V8 heap looked fine. Separating heap, RSS and container limits, and a sizing procedure for worker counts, reloads and probes.
Nuxt in Production -
Security in a Nuxt SSR App — Following One Write Through the Boundaries
Following one write operation through every boundary of a Nuxt SSR app: who the request is from, whether the user intended it, whether they may do it, and where server code is not a safeguard.
Nuxt in Production -
Deferred Hydration — Deciding What Is Allowed to Wait
Deciding which components may hydrate late and which must not, what an idle callback actually promises, and why deferred work is moved work rather than work removed.
Nuxt in Production -
Kinds of Waiting — Measuring Before Choosing a Performance Fix
A page can look fast and still feel slow. Telling the kinds of waiting apart and measuring at the same boundary before and after, instead of guessing at a performance fix.
Nuxt in Production -
Multi-Environment Infrastructure — One Setting, Three Environments, No Divergence
One build artefact, three environments, and the release that deploys successfully with a setting nobody intended. Configuration, deployment revisions, probes and rollback.
Nuxt in Production -
Hydration Mismatches — Finding and Fixing What the Server and Browser Disagree On
A page that is correct when it arrives and wrong a moment later. Hydration mismatches as a category: state initialization, event replay, and a cookbook for fixing rather than hiding them.
Nuxt in Production -
A/B Testing at the SSR Level — One Assignment per Request
Server and browser can disagree about which variant a visitor sees. Assigning once per request, reusing the assignment during hydration, and keeping cache identity and evaluation honest.
Nuxt in Production -
Visibility Rules and Editor Preview — Explaining Why a Section Is Not There
An editor cannot tell whether a missing section is a draft, a cached result, an unsupported type or a visibility rule. Connecting rule evaluation and live preview so it can be explained.
Nuxt in Production -
Nuxt and a Headless CMS — Serving Pages the Router Has Never Heard Of
Server-rendering editorial pages that no file-based route describes, using a catch-all route, generated component dispatch and stub-and-load fetching, with the trade-offs named.
Nuxt in Production -
The Compose Pattern — Mapping Variant Props to Class Names Outside the Template
Moving variant styling out of the template: a pure function maps typed props to class names per component region, which makes reuse simpler and the mapping unit-testable.
Nuxt in Production -
Two Toolkit Modules — Generating Composables for Queries and Typed Translations
Two Nuxt modules that generate the entry points developers would otherwise wire by hand: a composable per GraphQL query and a typed object for parameterized translations.
Nuxt in Production -
Nuxt Module Boundaries — What They Enforce and How Modules Communicate
What a Nuxt module actually enforces, how to declare its public interface and SSR-safe state, and how modules communicate without recreating the coupling the migration removed.
Nuxt in Production -
GraphQL-Based Code Generation — Moving Contract Errors Into the Build
Deriving client types and operations from the GraphQL schema so a renamed or newly nullable field fails the build instead of the browser, and what generation still cannot check.
Nuxt in Production -
The @delegate Directive Deep Dive — One Field, Two Subgraphs
A custom delegation directive built on graphql-tools: how one field resolves across two subgraphs, and what happens when the same field appears on a list of fifty documents.
Nuxt in Production -
GraphQL Schema Stitching — Composing One Schema and Owning the Consequences
Composing CMS content and application records into a single GraphQL schema, and owning what composition makes your problem: cache identity, invalidation, and partial failure.
Nuxt in Production -
Dryv Cross Stack Validation
Dryv lets you define validation rules once in C# and run them in the browser too: how rules are delivered, generated into JavaScript, and used inside Vue components.
Tools and Automation -
Introspection Forms
Your backend schema already describes every form field. Introspection Forms reads it and generates working, validated, reactive forms at build time instead of restating it by hand.
Tools and Automation -
The Target Architecture — Who Owns Which Decision on One Request
One request for one document page, followed through Nuxt, an in-process GraphQL gateway and a .NET backend, naming which component owns each decision along the way.
Nuxt in Production -
Duplicated Contracts — When a One-Field Change Touches Six Places
Adding one field to a document page touches six places at once. Where duplicated contracts and dual rendering come from, and how to judge what the synchronization costs.
Nuxt in Production -
Prizmik Azure Management
A hands-on review of Prizmik, an Azure management tool built around the work the portal makes slow, with a close look at Container Apps. Written by the tool's creator, with disclosure.
Tools and Automation -
Securing the Backing API of Your Xamarin App With Social Logins and ASP.NET Core 2, Part 1
Letting users sign in to a Xamarin app with Google, Facebook or Twitter while the login happens on the ASP.NET Core 2 server: choosing the OAuth flow and setting up the project.
Xamarin and ASP.NET Core -
Securing the Backing API of Your Xamarin App With Social Logins and ASP.NET Core 2, Part 2
Continuing the social login setup: configuring the external providers on the ASP.NET Core 2 API and connecting the browser-based login to the Xamarin app.
Xamarin and ASP.NET Core -
Xamarin on Android: Bypass SSL Verification With HttpClient
Disabling certificate checks for HttpClient on Xamarin Android means subclassing AndroidClientHandler with your own socket factory and hostname verifier. For testing only.
Xamarin and ASP.NET Core -
ASPNETCORE 2.0 Identity – Redirect URL signin-* Returns 404
After migrating to ASP.NET Core 2.0, external login callbacks return 404. Authentication is no longer added to the pipeline implicitly, so UseAuthentication must be called.
Xamarin and ASP.NET Core -
Xamarin: Failed to create JavaTypeInfo for class … due to System.NullReference Exception
A JavascriptInterface method taking System.Object breaks the Xamarin Android build. The Java code generator cannot map that type, and Java.Lang.Object is what it needs.
Xamarin and ASP.NET Core -
VS2017 Failed To Install – Setup Failed To Detect Shared Configuration
Visual Studio 2017 setup failed with setup failed to detect shared configuration. The log pointed at Web Deploy, and reinstalling the IIS Windows feature fixed it.
Visual Studio and T4 -
C#: Loading Dynamic Assemblies Into Other AppDomains
Dynamic assemblies cannot simply be shared between AppDomains. What fails when you try, why it fails, and how to get generated code into another AppDomain anyway.
Runtime Code Generation in .NET -
Parse Date From String In JavaScript
Turning a date string such as an ISO timestamp or 5/15/2015 into a JavaScript Date object with Date.parse, and checking the result.
Browser JavaScript -
In-Memory Code Generation at Run-Time With .NET – Part 5 – Loading
Part 5: finding the generated types and creating instances of them, using Reflection, a dependency injection container, or the Managed Extensibility Framework.
Runtime Code Generation in .NET -
C#: Getting Installer Product Data From Hosted Web PI GUI
Reading which products a hosted Web Platform Installer instance installs, and tracking the installation status, through the installer service proxy.
Windows Installer and Deployment -
C#: Getting Feedback From Hosted Web PI GUI
Hooking into a hosted Web Platform Installer instance to receive notifications about what happens during installation, so later steps can react to it.
Windows Installer and Deployment -
C#: Hosting Web PI GUI In Own Application
Hosting the Web Platform Installer user interface inside your own Windows Forms application, so your installer can drive it and then continue with its own steps.
Windows Installer and Deployment -
C#: Test For Elevated Privileges
Find out whether your code is running as administrator by testing the current Windows principal for the built-in Administrator role.
C# and .NET Notes -
Modify Web Platform Installer Configuration with C#
The Web Platform Installer GUI accepts no parameters. How to change its feed and settings from C# so the user still gets the interface with your configuration.
Windows Installer and Deployment -
TFS: Get And Modify Included And Excluded Pending Changes in Visual Studio
Read and change which pending changes are included or excluded in the Team Explorer Pending Changes view from a Visual Studio package.
Visual Studio and T4 -
Reflection Emit and Type Inheritance: Calling Base Type Constructors
With Reflection.Emit there is no C# compiler to insert the base constructor call for you. How to emit that call so a generated type can inherit a custom base class.
Runtime Code Generation in .NET -
Reflection Emit: Creating Properties
Copy-paste Reflection.Emit code that adds a backing field, a getter and a setter to a type generated in memory.
Runtime Code Generation in .NET -
Roslyn: Compile C# Expressions Without Using the Scripting API
Compiling small C# expressions with Roslyn without the scripting API, so you keep control over the resulting assembly and the AppDomain it is loaded into.
Runtime Code Generation in .NET -
WF 4.0: NullReferenceException in ActivityXamlServices.Load
Loading workflow XAML from a database fails with an unknown-type exception or a bare NullReferenceException. What the errors mean and the workaround that loaded the activity.
C# and .NET Notes -
Fast Named Formats In C#
Format strings that reference object properties by name, such as My name is {Name}, with the emphasis on making the substitution fast rather than only correct.
Runtime Code Generation in .NET -
Dynamically Determine MIME Types in C#
Windows already knows the MIME type of most file extensions. Read the Content Type value under HKEY_CLASSES_ROOT instead of shipping your own lookup table.
C# and .NET Notes -
ANTLR cannot generate ‘org.antlr.v4.codegen.CSharp_v4_5_1Target’ code as of version 4.1-SNAPSHOT
The ANTLR 4 C# target refused to generate code for a grammar. Setting the project's target framework to .NET Framework 4.5 made the build succeed, plus the full error output.
C# and .NET Notes -
Adding Solution Folders Via Visual Studio Automation
Create the virtual solution folders shown in Solution Explorer from code through EnvDTE, rather than adding them by hand.
Visual Studio and T4 -
Add A Namespace Import Via Visual Studio Automation
Read and add namespace imports, using in C# or Imports in VB, in a code document through Visual Studio automation with FileCodeModel and CodeImport.
Visual Studio and T4 -
Automatically Loading VSIX Packages
Make a VSIX package load even though it contributes no menu item, command or tool window, by applying ProvideAutoLoadAttribute with a suitable UI context.
Visual Studio and T4 -
Video links: JavaScript in Various Browsers
A collection of talks about JavaScript engines such as V8, SpiderMonkey and Chakra, and about writing code these engines can actually optimize.
Browser JavaScript -
Use T4 Templates For XSLT Transformation
Run XSLT style sheets from a T4 template so Visual Studio's normal template integration triggers the transformation, and the one obstacle that gets in the way.
Visual Studio and T4 -
Resolve Visual Studio Macros In VSIX Packages Or T4 Templates
Resolve Visual Studio macros such as ProjectDir, ConfigurationName and OutDir from your own VSIX package or T4 template using IVsBuildMacroInfo.
Visual Studio and T4 -
Inheriting a T4 Template and Calling EnvDTE.DTE: The System Cannot Find The File Specified
Moving T4 logic into a base class that loads the automation object fails with the system cannot find the file specified. What breaks assembly resolution, and how to avoid it.
Visual Studio and T4 -
“IDENTITY_INSERT is already ON for table X” When Applied to Multiple Tables
Only one table per session can have IDENTITY_INSERT set to ON, which is why switching it on for several tables at once fails, and how to write the insert script instead.
SQL Server and Entity Framework -
Linq Expressions By Sample: Calling Generic Methods With Lambda Parameters For Unknown Types
Calling a generic method whose type arguments and delegate parameter are unknown at compile time, by building and compiling a Linq expression at run time.
Runtime Code Generation in .NET -
Loading Assemblies In New AppDomain (And Unloading Them)
Loading assemblies into a separate AppDomain to inspect their types, and the small detail that quietly loads them into the main AppDomain and makes unloading impossible.
Runtime Code Generation in .NET -
Change Current Thread’s Currency Symbol
The current thread's culture is read-only, so assigning a new CurrencySymbol throws. Clone the CultureInfo, change the symbol, and assign the clone back to the thread.
C# and .NET Notes -
Get The ProjectItem of a T4 Template From Inside the T4 Template
Reach the ProjectItem of a running T4 template, or its parent project, by making the template host-specific and going through Visual Studio automation.
Visual Studio and T4 -
Write To Visual Studio’s Output Window
Write messages into a pane of the Visual Studio Output window from an extension, using IVsOutputWindow and making sure the pane is visible.
Visual Studio and T4 -
Modal WPF Windows And The Visual Studio Window
Show a modal WPF dialog from a Visual Studio extension by taking the IDE's main window handle and passing it to WindowInteropHelper.
Visual Studio and T4 -
Tell if an EnvDTE.Project is a Web Application
Deciding whether an EnvDTE project is a web application is awkward because of a Visual Studio bug. Code that answers it reliably enough to know which config file to expect.
Visual Studio and T4 -
Write To Visual Studio’s Error List
Add errors, warnings and messages to the Visual Studio Error List from an extension with ErrorListProvider, including navigation back to the offending file.
Visual Studio and T4 -
Get Project References From EnvDTE.Project
Enumerate the assembly and project references of a Visual Studio project from an extension by casting Project.Object to VSLangProj.VSProject.
Visual Studio and T4 -
Manually Applying XML Document Transform (XDT)
Apply an XDT transform to a web.config or app.config in your own code, using the transformation classes from Microsoft.Web.Publishing.Tasks.
Visual Studio and T4 -
Automatically Re-Create Stored Procedures In SQL Server
A cursor-based script that drops and recreates every stored procedure in a database, so stale dependency information in sysdepends is rebuilt.
SQL Server and Entity Framework -
A Flexible And Convenient Type Conversion Helper in C#
A small reusable C# helper that converts an object to a target type known only at run time, so calling code stays readable instead of turning into if-then-else chains.
C# and .NET Notes -
Listing Objects Used in Stored Procedures (MS SQL)
A query over sysdepends and sysobjects that lists the tables, views, functions and procedures each stored procedure uses, for finding tables nobody references any more.
SQL Server and Entity Framework -
In-Memory Run-Time Code Generation With .NET – Part 2
Part 2: producing C# source at run time with templating engines. T4, StringTemplate and DotLiquid compared on the same generation task.
Runtime Code Generation in .NET -
In-Memory Run-Time Code Generation With .NET – Part 3
Part 3: turning generated source into a usable assembly in memory, first with CodeDom and then with Roslyn, including references and compilation errors.
Runtime Code Generation in .NET -
In-Memory Run-Time Code Generation With .NET – Part 4
Part 4: generating types straight from a model with no source code in between, using Reflection Emit to write MSIL and by compiling Linq expression trees.
Runtime Code Generation in .NET -
In-Memory Run-Time Code Generation With .NET
Part 1 of a series on generating .NET types at run time: the general approach and the generation model that the templating, compilation and loading parts build on.
Runtime Code Generation in .NET -
EF5 Migrations: Multiple Data Contexts in a Single Database
Entity Framework compares a data context against the single conceptual model in the migration history table, which is why several contexts in one database keep undoing each other.
SQL Server and Entity Framework -
Determine SQL Server Version and Edition
A one-line query using SERVERPROPERTY to read the product version, product level and edition of a SQL Server instance.
SQL Server and Entity Framework -
Convert IVsHierarchy to ProjectItem or Project
Convert an IVsHierarchy into an EnvDTE Project or ProjectItem by reading the VSHPROPID_ExtObject property for the item you are interested in.
Visual Studio and T4 -
Helpful JavaScript Methods for the Telerik Grid for ASP.NET MVC
Client-side helpers for the Telerik MVC Grid: selecting and deselecting rows from code, walking hierarchical grids, and filtering rows without repopulating the whole grid.
Browser JavaScript -
Getting The Database Connection String From an ObjectContext
Cast an ObjectContext's Connection to EntityConnection and read StoreConnection to reach the underlying database connection string.
SQL Server and Entity Framework -
.NET Client With HTTPS Certificate Authetication Fails With Timeout
A .NET client using mutual TLS times out. Wire captures show the client never sending its certificate after the request, and forcing SSLv3 got the connection working.
WCF and Transport Security -
Handle Clicks On Calendar Items In SharePoint 2010 With JavaScript
The SharePoint 2010 calendar view exposes no click event for items. Overriding CalendarContainerFactory.create once the calendar script has loaded adds the hook yourself.
SharePoint -
Code Generation And Manipulation Using T4 Templates And Visual Studio Automation By Sample
A worked example that generates a DbContext with T4 while inspecting and modifying existing project items through Visual Studio automation.
Visual Studio and T4 -
Updating BDC Models in SharePoint 2010
SharePoint stores BDC models in its database and only replaces one when the deployed version differs, which is why redeploying a changed model appears to do nothing.
SharePoint -
Error 1402. Could not open key: UNKNOWN\Components\…
Error 1402 after cleaning up a half-installed package: the cleanup left a registry key behind without an owner or permissions. Restoring both makes installing work again.
Windows Installer and Deployment -
Windows Installer Cleanup Utility (MSICUU2) Discontinued
Microsoft discontinued the Windows Installer Cleanup Utility that removed a product whose uninstall routine is not finished yet. Where the tool can still be obtained.
Windows Installer and Deployment -
Windows Installer Custom Actions: Moving Properties from Immediate to Deferred Execution.
Deferred custom actions cannot read installer properties. How to hand data collected in the immediate phase over to the execution phase through CustomActionData.
Windows Installer and Deployment -
netsh http add sslcert "the parameter is incorrect"
netsh http add sslcert failing with the parameter is incorrect, caused by a colon instead of an equals sign after ipport. The corrected command line.
WCF and Transport Security -
Debugging Custom Actions in Windows Installer
MSI packages cannot be run in debug mode from Visual Studio, so call Debugger.Launch inside the custom action to attach a debugger and step into your code.
Windows Installer and Deployment -
SSL Needs Certificates
A self-hosted WCF service over SSL needs a certificate bound to its port. What the configuration looks like, and what it looks like when the certificate is missing.
WCF and Transport Security -
Dynamically Configuring WCF Services
Configuring WCF services at run time from XML configuration snippets, instead of coding every possible binding and behavior option by hand.
WCF and Transport Security