Analyzing .NET Assembly Architecture

Have you ever installed an IIS website only to get an error that there is an assembly with the incorrect format in the bin folder? How about when you’re installing a window service and you’re not sure if the application is 32-bit or 64-bit? Sure, there are free tools like the Telerik Decompiler that will let you poke around those .dlls to see what cpu architecture they are built for, but what if you have dozens of dlls in one folder?

NetAssemblyAnalyzerWindow

This utility will dump a list of all .Net assemblies in a folder and display their CPU architecture.

It can be found on GitHub here: https://github.com/szahn/AssemblyAnalyzer

The utility works by querying the ProcessorArchitecture attribute using reflection.

Advertisements

Using DotNetNuke (DNN) on a Load Balanced Web Farm

DNN has been known to have cache issues, especially when used on a load balancer. Since the DNN community edition suffers from a lack of web farm support, caching always behaves unusual whenever a deployment is made. To avoid having to pay royalties and support fees to DotNetNuke for the enterprise edition, some companies opt for a work around the common cache problem. A quick and dirty way to solve this problem is to clear the cache and recycle the app pool.

To clear the DNN cache, one can go to Host > Schedule. For “Purge Cache” and “Purge Module Cache”, click the edit icon, then enable the schedule and run it. A hard refresh on the browser (usually CTRL F5) is also recommended.

When making changes to DNN on a web farm, it’s best to recycle the app pool. The command below will recycle the app pool

%systemroot%\system32\inetsrv\AppCmd.exe recycle APPPOOL MyAppPoolId

Using AppCmd, you can get a list of app pools by executing

%systemroot%\system32\inetsrv\AppCmd.exe LIST APPPOOL

Furthermore, this command can be wrapped in a powershell command and executed remotely

function RecycleAppPool($serverName, $appPoolId){
    Invoke-Command $serverName { param($appPoolId) %systemroot%\system32\inetsrv\AppCmd.exe recycle APPPOOL $appPoolId } -Args $appPoolId
}
$WEBPROD1 = "x.x.x.x";
$WEBPROD2 = "x.x.x.x";
RecycleAppPool $WEBPROD1 "SiteAppPoolId"
RecycleAppPool $WEBPROD2 "SiteAppPoolId"

To enable Powershell, you may need to run this command in CMD as an admin:

Set-ExecutionPolicy unrestricted

To enable powershell remoting, run the following command on the remote server you wish to control

Enable-PSRemoting -force