My second talk for the ANZ Coders virtual conference is now online. “10 unusual tips & tricks for .NET” manages to demonstrate 10 different tips in under 30 minutes.
Source code for the demos is on Github. Over time, I hope to add to this repo as I come across new tips.
If you prefer to see something in-person (and with pizza), then come along to the next Adelaide .NET User Group meeting on June 10th, when I’ll be doing an “extended play” version of this talk (and probably by then with a couple of extra tips thrown in to boot!). Register on MeetUp.
So for situations where you’re hosting a number of ASP.NET web applications on the same server and they share some common assemblies, aspnet_intern can help mitigate the problem that each assembly copy has to be read separately during cold site startup and kept separately in memory.
On a machine with Visual Studio 2013 installed, aspnet_intern.exe can be found in C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\.
Here’s the usage details:
Microsoft (R) ASP.NET Intern version 4.0.30319.33440
Utility to analyze ASP.NET web applications and intern common .NET assemblies found in the Temporary ASP.NET Files directory.
Copyright (C) Microsoft Corporation. All rights reserved.
aspnet_intern [-mode analyze|exec|clean|query] [-sourcedir <input source path>] [-interndir <output target interned path>]
-? Display this help text.
-mode analyze Analyze source directory for managed assemblies that can be
interned for cross application sharing (default)
-mode exec Perform interning of managed assemblies for cross
-mode query Display information about shared assemblies in the intern
-mode clean Deletes the intern directory and all symbolic links in the
source directory pointing at files in the intern directory
-sourcedir Source directory to scan for potential assembly interning
candidates. Use either the Temporary ASP.NET Files
directory location, or the location defined in the
system.web/compilation/tempDirectory web.config attribute.
-interndir The location where interned assemblies are stored for
sharing across ASP.NET applications.
-v Verbose output
-bpc Bypass platform checks
-minrefcount The minimum number of times an assembly was found in
different locations for the assembly to be considered an
interning candidate. (Default: 3)
-whitelist Only allows interning of managed assemblies that are
contained in this file. Value should be the full file path
to a line delimited list of patterns which may contain a
trailing asterisk which will turn the pattern into a prefix
match. i.e. MyAssembly-1.*
aspnet_intern -mode analyze -sourcedir "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files"
aspnet_intern -mode exec -sourcedir "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files" -interndir C:\ASPNETCommonAssemblies
aspnet_intern -mode clean -sourcedir "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files" -interndir C:\ASPNETCommonAssemblies
aspnet_intern -mode query -interndir C:\ASPNETCommonAssemblies