If you are using IIS Shared Configuration and changed the password for the account accessing the file path, you might encounter the following error
The World Wide Web Publishing Service service depends on the Windows Process Activation Service service which failed to start because of the following error:
The user name or password is incorrect.
The Windows Process Activation Service service terminated with the following error:
The user name or password is incorrect.
Windows Process Activation Service (WAS) is stopping because it encountered an error. The data field contains the error number.
Internet Information Services (IIS) Manager will also start with a weird error message and then prompts you to login
All these points to an inability to access the shared configuration
How to resolve?
To turn off either one, first start an administrator mode command prompt
and then type the required commands
#turn off hibernate
powercfg /H off
powercfg -change -standby-timeout-ac 0
Note, all cmdlets must run in administrator mode powershell preferable from the Caching Administration shortcut, else in any normal powershell, run
An easy way to get all the commands available in the module is to run the following powershell
Get-Command -module DistributedCacheAdministration | Sort-Object > C:\AppFabric.txt
Get-AFCacheHostStatus, gets the status of the cache hosts in the cluster
Get-CacheStatistics [cachename], gets statistics about the cache
Get-CacheClusterHealth, gets the health of the Cache Cluster
Get-CacheHostConfig, gets the host configuration
Get-CacheConfig [cachename], gets the cache configuration
The name of the cache.
The default time that items reside in the cache before expiring.
The type of cache. This is always Partitioned.
A value of 1 indicates that the cache uses the high availability feature.
Indicates whether objects in the cache can expire.
Specifies an eviction type of Least-Recently-Used (LRU) or None.
Indicates whether notifications are enabled for this cache.
Some other useful URLs
One of the things about AppFabric is that you cannot run it directly via services
NEVER and I mean NEVER set this to automatic, you will pay dearly for this
The recommended way is to run the Caching Administration Powershell shortcut
and then run Start-CacheHost
HOWEVER, there is a way for AppFabric to automatically start upon computer start up, what you need to do is to create the following powershell script and save it somewhere, e.g c:\appfabric.ps1
$computer = gc env:computername
start-cachehost -hostname $computer -cacheport 22233
Then add a scheduled task with the following settings
Reboot the computer and watch AppFabric automagically startup on boot, enjoy!
If you are using Windows Server 2012R2, following the steps in http://wp.me/pBjCs-am will get it working.
HOWEVER if you need cache secondaries i.e
New-Cache Cache1 –Secondaries 1
You will realize that cache redundancy is not working at all, this is because AppFabric is looking for an enterprise version of windows, which is non-existent in Windows Server 2012R2
What you need to do is to download AppFabric 1.1 CU 4 found at http://support.microsoft.com/kb/2800726/en-us. This enables the High Availability feature in Windows Server 2012 Standard SKU and above
For safety, please down your entire caching service before applying this CU, the CU does attempt to stop the cache host, but always err on the safe side
Sometimes there is a need to remotely unplug and plug in a blade
To do so, ssh into the HP OA ip address then run the following command
reset server <bay>
You will then be presented with a prompt similar to below
And if you enter yes, you should see a message similar to
and the bay should disappear from HP Onbard Administrator and reappear again later
As of writing, there are various forms of HTML Encoding
- The old school version, e.g <, >l&
- URL Encoding e.g %20
- HTML Entities/HTML Number e.g ! (http://www.ascii.cl/htmlcodes.htm)
However the built in libraries in .NET is only capable of handling #1 and #2
For #2, we can use the same libraries as #1 but changing it to URLDecode
However it seems there is no built in libraries to handle #3. The good news is there is an easy way to do it with the current available libraries in .NET
Since all HTML entities are in the format &#[number]; we can use regex to find all of such patterns and replace them with the equivalent character (char)number
Sample code of such a function:
static string HtmlDecode(string s)
var s2 = WebUtility.HtmlDecode(s);
foreach(Match M in Regex.Matches(s2, @"\&\#(.*?)\;", RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.Singleline))
s2 = Regex.Replace(s2, @"\&\#" + M.Groups.Value + @"\;", ""+(char)Convert.ToInt64(M.Groups.Value), RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.Singleline);