5 posts tagged “automation”
Suppose you don't want to modify any of your projects in your solution. Create a new msbuild.proj file and run msbuild on this with your configuration. Instantly you have all your assembly info files updated for any project in a directory.
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="build">
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\SvnTools.Targets\SvnTools.Tasks.VersionManagement.Tasks" />
<Target Name="build">
<CreateItem Include="/Properties/AssemblyInfo.cs;/AssemblyInfo.cs">
<Output TaskParameter="Include" ItemName="AssemblyInfoFiles" />
</CreateItem>
<UpdateVersion AssemblyInfoFiles="@(AssemblyInfoFiles)" />
<MSBuild Projects="MySolution.sln" Properties="Configuration=Debug" />
<RevertVersionChange AssemblyInfoFiles="@(AssemblyInfoFiles)" />
</Target>
</Project>
http://svnversiontasks.codeplex.com
When was the last time you decided you needed to deploy a product of yours. How often is it that you run into a situation where configuration and the manual to installation of your projects becomes a royal pain in the neck? Well, for most, maybe not all that often, but for the few in the corporate world - this may happen all too often.
using System.Security.Cryptography.X509Certificates;
namespace AddCert
{
class Program
{
static void Main(string[] args)
{
if (args.Length != 7 && args.Length != 5)
Console.WriteLine("Usage: addcert cert.pfx /r LocalMachine /s My /pass mypass");
string path = args[0];
StoreLocation sl = (StoreLocation)Enum.Parse(typeof(StoreLocation), args[2]);
StoreName sn = (StoreName)Enum.Parse(typeof(StoreName), args[4]);
X509Store store = new X509Store(sn, sl);
store.Open(OpenFlags.ReadWrite);
if (args.Length == 5)
store.Add(new X509Certificate2(path));
else if (args.Length == 7)
store.Add(new X509Certificate2(path, args[6]));
store.Close();
}
}
}
Every now and then it's always nice to have a little system of automation to ease your way into deployment, packaging and all sorts of interesting things. To do so, all you have to do is dance dance! :D

- Copying the target directory to a deployment folder: copy "$(TargetDir)" "$(SolutionDir)Deployment\"
- Copying the target path to the deployment folder: copy "$(TargetPath)" $(SolutionDir)Deployment\"
- Running a script to cleanup the leftovers:
Within a bat file you can select all the directories within a directory where the given name appears:FOR /F "tokens=*" %%G IN ('DIR /B /AD /S bin') DO RMDIR /S /Q "%%G" FOR /F "tokens=*" %%G IN ('DIR /B /AD /S obj') DO RMDIR /S /Q "%%G" - Running a script to stop a service, uninstall it and then re-install it, and finally start it.
net stop MyServiceName
installutil -u Location\To\MyService.exe
installutil Location\To\MyService.exe
net start MyServiceName
Network monitoring is a pain in the neck. The major reason this is that way is party because it is a manual job for the most part. Writing scripts to automate, log and track information. But on the other hand, if we were to have a simple tool that shows the most important alerts front and center with a nice user interface - it is possible that network monitoring could be easier. Like this:

Here we can create an alert system on the right (always visible and automatically updating) and on the left hand side we can create column views. As an alternative to this, I was thinking of a canvas like area that we can zoom in and out of for context.
![]()
Here you can represent the monitoring objects of interest by icons and should there be any issues you add error, critical or warning icons to show that there is an issue. We could create different types of icons to represent things like servers, server applications, websites, clients, network routers, printers, fax machines and more. Best of all, we can maintain this is a small space since we are only displaying the most important information first.
Dr. James McCaffrey has a very nice way to perform testing automation on Custom Ajax driven websites. The testing automation works really simply since everything is executed and logged via client-side javascript code.
The popularity of Web applications that use AJAX (Asynchronous
JavaScript And XML) technology has increased steadily over the past
year. When written correctly, AJAX can yield significant improvements
in performance and user experience compared with non-AJAX Web
applications. However, because AJAX Web applications work
asynchronously, traditional synchronous test automation techniques
generally don't work. In this month's column, I present a technique
that allows you to write lightweight test automation to verify the
functionality of AJAX Web applications.
More after the jump.
