Skip to main content

Posts

Showing posts from September, 2006

dotNET Web Application Stress Testing

Stress Testing ASP.NET Web Apps is all about simulation heavy usage and isolating bottlenecks. There are some Microsoft Tools available, see below. These tools allow you to create scenarios on your website, increase number of users and view the results. I'll report back with more information when I actually use these tools. For now this is just a placeholder. Microsoft Stress Test Tool, ACT, Application Center Test. Available from your Visual Studio Enterprise Edition DVD. Older Stress Test Tool, downloadable from msdn. http://www.microsoft.com/downloads/details.aspx? FamilyID=E2C0585A-062A-439E-A67D-75A89AA36495&displaylang=en"> Other useful resources could be Windows Performance Counters. These are Windows information that is available on Processes and Threads running. You can provide your own applications Performance Counter information be incrementing the Performance counter containers. The information is Viewable on the Perfmon.exe available on Windows machines. ht...

dotNET AppDomain and Remote Computing (Remoting)

AppDomain If for some reason you find that you're application cannot load an Type/Assembly at runtime it's usually because assembly lives somewhere different at runtime. For instance the host could do some copying to temporary locations at runtime, this can sometimes cause the references between assemblies to breakdown. So how do you tell the runtime to look somwhere else for the assembly well that's where the AppDomain comes into play. AppDomain refers to the namespace, space allocated in .NET memory/CLR in which your application is allowed to run. It's a security thing which prevents applications from cross communicating with each other. Reasons why you'd want to access the AppDomain can include: Need to manage the AppDomain i.e. delete or add resources from outside the applications namespace. If you wanted to ensure that certain assemblies for example were to be unloaded from another AppDomain at a certain point, you'd have to setup a new AppDomain and someho...

dotNET Serialization (XmlSerializer)

Serialization is the process of representing you Object in the form of text. This is a handy way to save out your Object structure to a file. The XML version is XmlSerializer, this creates an XML file structure of your Object. It will parse out all the public properties and save to XML. You can make your objects Serializable by simply adding the Serializable Attribute to each of your objects, when you call Serialize on that Object it and all of it's Child and Associated Objects which also have the Serializable Atribute will also be Serialized [Serializable] public class BaseballPlayer { [...] } To invoke Serialization on an Object you need a Formatter and a Stream. Or you can use XmlSerializer to perform the Serialization. see XMLSerializer and not expected type... (codeproject) Stream str = File.OpenWrite(filename); System.Runtime.Serialization.Formatters.Soap.BinaryFormatter formatter = new System.Runtime.Serialization.Formatters.Soap.BinaryFormatter(); formatter.Serialize(s...

MSBuild

MSBuild Team Blog. MSBuild documentation (msdn) BuildTask creation MSBuild used by VS projects to build items. You can add build tasks to your Project file, either by directly adding to the .proj file or by creating .targets files with the task within and then adding this .targets file to your project file using the include option. The BuildTask can do anything you wish but the format which you call it is basically the same. To use a build task you must include the file that contains the BuildTask functionality. The BuildTask itself is just a class that extends Microsoft.Build.Utilities.Task . Compile it into a dll and include the dll in your project file with the UsingTask . The AssemblyFile points to the location and name of the task's assembly, AssemblyFileName can also be used but only requires the file name, this means the file must be in the GAC or in the installation of .NET. <pre> <usingtask taskname="SetupUtils.RegistryTask" assemblyfile="...

Delegates

Delegates Delegates are similar to C++'s function pointers, as it says on the tin a pointer to a function. The beauty of delegates and function pointers is that you can throw it around in different classes without that class having knowledge of the object to which the function belongs. Here's a simple example: declare your delegate in some class. public delegate void DelegateFunc();// you must have a func with the same signature now create a function in another class with same return type and same parameters. class DelegateClass { public static void TheRealDelegateFunc() { } } now call the delegate from the first class public delegate void DelegateFunc();// you must have a func with the same signature static void Main(string[] args) { DelegateFunc df = new DelegateFunc(DelegateClass.TheRealDelegateFunc); df.Invoke(); } Notice the Invoke() function, this is required to r...