Tuesday, July 29, 2008

Error: The name 'instance-variable' does not exist in the current context

Recently I got the following error "The name 'instance-variable' does not exist in the current context" where 'instance-variable' was the member variable of one of my page.  I was really confused as I was sure that I was doing it right.  So what else could be the problem?  Well it turns out that I had made a backup copy of the file in the same directory before I had changed it.  I turns out that in a Asp.Net 2.0 website you can't have two ASP.NET pages or user controls with the same name class name.  Because the pages are partial classes it does not give the error "The namespace 'global-namespace' already contains a definition for 'instance-variable'" like you would normally get if you redefined a class.  Read more here...

Thursday, June 05, 2008

Microsoft ACT standalone installation

Microsoft ACT is great for stress testing web sites. The only "problem" is that you have to install Visual Studio .NET in order to use it. I use it frequently on my dev machine but some times it is useful have it on a remote machine for stress testing directly in a pre-production environment. The steps below shows how you can copy your local ACT installation to a standalone computer.

Pre-requisite: Internet Explorer 6.0

Steps by step instructions:

  • Copy the C:\Program Files\Microsoft ACT directory from you dev PC to the same directory on the remote machine
  • Create the Act.Reg and Register.cmd files below
  • Execute Register.cmd
  • Create a local user: ACTUser with the "User" rights
  • Set the Identify of the following COM objects to ACTUser (using dcomcnfg):
    • Application Center Test Broker
    • Application Center Test Controller
  • Give full control to ACTUser on the following WMI namespace using "Computer Management": Root/CIMV2/Application/MicrosoftACT

== Save as Register.cmd ==
cd "C:\Program Files\Microsoft ACT"
regedit -s act.reg
for %%i in (*.dll) do regsvr32 /s %%i
ACTBroker.exe -regserver
actcontroller.exe -regserver
ACTRegMof.exe -i "C:\Program Files\Microsoft ACT\actnamespace.mof"
ACTRegMof.exe -i "C:\Program Files\Microsoft ACT\actbroker.mof"
ACTRegMof.exe -i "C:\Program Files\Microsoft ACT\actcontroller.mof"

== Save as Act.Reg ==
Windows Registry Editor Version 5.00

"AppPath"="C:\\Program Files\\Microsoft ACT\\"

Disclaimer: Follow the instructions at your own risk and make sure you have a working backup!