Tuesday, March 31, 2009

Error on saving Fiddler session as Visual Studio Web Test

A couple of days back, I used Fiddler to save a session as a Web Test and curiously got this error..
--------------------------
Error during save...
---------------------------
One or more plugins returned an error, but the remaining plugins executed and the WebTest was written.
---
Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

After going through this forum post, and modifying the Fiddler.exe.config file, I was able to save VSTS web tests using fiddler,

This was happening because, Fiddler was expecting Visual Studio 2005 assemblies and started complaining when it was not able to find them.

In order to work around this, we need to specify a binding redirect in the configuration file (fiddler.exe.config), so that the assembly resolver will resolve the 8.0 reference to the 9.0 assembly


<configuration>
<runtime>
<legacyUnhandledExceptionPolicy enabled="1" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.WebTestFramework"
publicKeyToken="b03f5f7f11d50a3a"
culture="Neutral" />
<bindingRedirect oldVersion="8.0.0.0"
newVersion="9.0.0.0"/>
<codeBase version="" href="C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.WebTestFramework.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Tuesday, November 11, 2008

High resource consumption by ld-linux.so.2 on Ubuntu 7.10

At random intervals, the memory consumption of a particular process i.e. ld-linux.so.2 would rise abruptly high, and at times, the processor usage would rise too. The culprit in my case was Adobe Acrobat Reader 8.0 and the solution was simple too. There is a package lsb (Linux Standard Base) which will be used by Adobe Acrobat instead of ld-linux.so.2 if available.

I dont mind using Evince or other pdf viewers, but I need Adobe Acrobat Reader to view some portfolios generated using the Adobe Acrobat Office pluging containing multiple pdf s one file.

Running VMWare ESXi on Low End Hosts

In order to evaluate ESXi for use in test environments, I had installed it on a low end host (a DELL Optiplex GX520 desktop) and tried to run two virtual machines on it. However, when I would try to start the second virtual machine, it would throw an “Admission check failed for Memory Resource” error on me. I wasn’t able to figure out why this was happening as I had run two virtual machines with the same configuration on a host with similar resources using VMWare Server.

All that needs to be done is to modify the memory reservation in the resource allocation tab

1. Open the VMWare Infrastructure interface to the ESXi server
2. Select Configuration >> System Resource Allocation >>Advanced
3. Click on Edit Settings and edit the memory reservation and change it to 256 MB or lower (as per requirement)

Thursday, September 04, 2008

Identification of SQL Server Edition and Version

This query can be used to identify the SQL Server Version and Edition currently in use on a server.

SQL 2005
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

SQL 2000
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

SQL 7.0 and earlier
SELECT @@VERSION

The following is a KB article for this.
KB 321185: How to identify your SQL Server version and edition

Detecting the installed version of .NET

Open a command prompt and run the command

dir %systemroot%\microsoft.net\framework\v?.* /ad /b


This will list all the versions of .NET framework installed on the system

Friday, December 14, 2007

Using the Seapine TestTrack SOAP API

Our organization has been using the Seapine Test Track defect management system for about a year and recently I had to migrate defects from the existing custom defect tracking system to Seapine. The migration process involved the use of the SOAP API made available by Test Track.

However, upon using the SOAP API, I kept getting the error

date' is an invalid value for the SoapElementAttribute.DataType property. The property may only be specified for primitive types


After spending some time with google and msdn, I found a couple of links which attributed the problem to incompatibilities in the proxies generated by .NET 1.1 and .NET 2.0.

Till this point of time, I was always using a live reference from my C# application to the web-service. Upon generating a proxy class using wsdl and replacing all
System.Nullable strings with DateTime in the generated class file, I was able to use the SOAP API without any further problems.

Copy Paste between remote desktop and local computer

In order to allow copy-paste functionality across remote desktop, ensure that the following services are running on the local computer and the remote system
1. Network DDE DSDM
2. Network DDE
3. ClipBook

Network Dynamic Data Exchange (DDE) is a technology that enables applications on different Windows computers to dynamically share data. This sharing is effected via communications channels called trusted shares, which are managed by a service called the Network DDE Agent. By design, processes on the local machine can levy requests upon the Network DDE Agent, including ones that indicate what application should be run in conjunction with a particular trusted share. The DSDM(Distributed Share Database Manager), manages the shared DDE(Dynamic Data Exchange) network conversations (from shares like: \\computername\ndde$).

However, a vulnerability exists because the Network DDE Agent runs using the Local System security context and processes all requests using this context, rather than that of the user. This would give an attacker an opportunity to cause the Network DDE Agent to run code of her choice in Local System context, as a means of gaining complete control over the local machine.

Friday, July 06, 2007

Increasing Site Storage for SharePoint Portal Personal Sites

SharePoint Portal admins can manage and share personal content. SharePoint has a limit on the amount of disk space associated with each personal site; I think the default is set to 100MB. You can change this quota through the Administrative Tools (under 'Manage Quotas and Locks') but this will NOT impact any existing sites. Here is how you increase the site storage quota for an existing site:
1. Go to SharePoint Central Adminsitrator
2. Click Windows SharePoint Services
3. Click Manage Quotas and Locks
4. Click Manage site collection quotas and locks
5. Enter the URL for the specific personal site (e.g.http://in-srv-qaapp)
6. Click View Data
7. Under Site Quota Information, select Individual Quota under Current quota information
8. Change the site storage limit and click OK

Sunday, May 13, 2007

Verifying .net assembly attributes recursively

I was once given the responsibility of verifying the assembly attributes of all the assemblies in a .NET solution prior to each release. This was a very monotonous job considering the fact that this had to be done manually. For two of the releases, I used to open the properties of each dotnet assembly and verify if the attributes were correct in the release version. In a better situation I would have gone through the assemblyinfo.cs in each project and verified it (which is no better), but sadly I did not have access to the versioning server.

I did a bit of soul searching and decided that this was not the correct way to go through it. I wrote a small win app that could be used to do this

FileStream txtfile;

StreamWriter sw;

private void btnCheck_Click(object sender, EventArgs e)

{

try

{

txtfile = new FileStream(txtOutputFile.Text, FileMode.Create , FileAccess.Write);

sw = new StreamWriter(txtfile);

txtDirectoryPath.Text = dlgDirBrowser.SelectedPath;

string directoryPath = txtDirectoryPath.Text;

DirectoryInfo directoryInfo = new DirectoryInfo(directoryPath);

TraverseFolder(directoryInfo);

}

catch

{

MessageBox.Show("Directory path incorrect");

}

finally

{

sw.Close();

txtfile.Close();

MessageBox.Show("Done. File created "+ txtOutputFile.Text);

}

}

public void TraverseFolder(DirectoryInfo directoryInfo)

{

foreach (FileInfo fileInfo in directoryInfo.GetFiles("projectname*.dll"))

{

FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(fileInfo.FullName);

bool finalCheck;

finalCheck = (Assembly.LoadFrom(fileInfo.FullName).GetName().Version.ToString() == txtAssemblyVersion.Text)

&& (fileVersionInfo.ProductVersion == txtProductVersion.Text)

&& (fileVersionInfo.FileDescription == fileVersionInfo.OriginalFilename.Substring(0,fileVersionInfo.OriginalFilename.Length -4))

&& (fileVersionInfo.FileVersion == txtFileVersion.Text)

&& (fileVersionInfo.LegalCopyright == txtLegalCopyright.Text)

&& (fileVersionInfo.CompanyName == txtCompanyName.Text )

&& (fileVersionInfo.InternalName == fileVersionInfo.OriginalFilename)

&& (fileVersionInfo.ProductName == txtProductName.Text);

if (finalCheck == false)

sw.WriteLine(fileInfo.Name + " : Incorrect");

//else

// sw.WriteLine(fileInfo.FullName + " : Correct");

}

DirectoryInfo[] directories = directoryInfo.GetDirectories();

foreach(DirectoryInfo newDir in directories)

{

sw.WriteLine(" ");

sw.WriteLine("Directory: " + newDir.FullName);

TraverseFolder(newDir); // recursive call

}

}

Managing remote connections without tsadmin

Most of those who have worked on remote terminals using the Remote Desktop Connection utility would have faced the problem of not being able to connect because of disconnected session. The solution usually is to use the tsadmin utility to close the sessions. However, while working on a Windows XP, this is not available.

However, Windows XP does provide the following to perform this action
- qwinsta (Query Windows Station)
qwinsta /server:servername allows the user to view the sessions and obtain the session ids on a remote windows host
- rwinsta (Reset Windows Station)
rwinsta sessionid /server:servername

Monday, January 22, 2007

Deploying a Windows 2003 cluster using VMWare

I was once assigned to test an application which was to be deployed on a clustered Windows 2003 environment. The budget at that time did not allow us the luxury of having dedicated hardware for the clustering so we had to workaround the situation by using a virtual environment. I was able to find this wonderful article by Roudy Bob on Setting Up A Windows Server 2003 Cluster in VS 2005 - Part I but was not able to perform the same using VMWare.
Whenever a virtual machine was powered on, it used to lock the vmdk files thus not allowing the second node in the clustered to be powered. After some searching on various blogs, I was able to work around this problem by modifying the vmx file of the virtual machine to include the following statements (without the comments)

scsi0:sharedbus="virtual" //this shares the whole scsi bus 0
scsi0:0.shared="true" //this shares the scsi0 port 0
disk.locking="false" //for disk.

Removing the Quick Lauch in Sharepoint sites

Create a content editor on the right side bottom and save.

< style>
.ms-navframe
{
display: none;
}
</style>

Wednesday, March 29, 2006

Mounting ISO files

I had checked out DaemonTools and was wondering if something like this was available for Linux too. Then, I realized that optical media or other devices in Linux had to be mounted. A little bit of searching the man pages gave me this command to mount ISO files.

mount -o loop -t iso9660 isofilename mountpoint

Tuesday, January 24, 2006

Populating a combo box with enumerations

A simple function to populate a combo-box with the enumerations of a particular enum

private void populatecbo(System.Type enum_type, System.Windows.Forms.ComboBox combo)
{
Array arr_populate = Enum.GetValues(enum_type);
combo.DataSource = arr_populate;
}


A cast to type using typeof(enum_type) would be required during the call

Also retrieving the value would be easy

(enum_type)System.Enum.Parse(typeof(enum_type), combo.SelectedValue);

Monday, January 23, 2006

Opening Excel files in a browser in ASP.NET

I was developing a small ASP.NET app and was trying to open an excel file in the browser. After a couple of attempts, I discovered that I was specifying the incorrect MIME type. Upon using the following code I was able to get the excel file to open in the browser:

string fileName = Server.MapPath("HelloWorld.xls");
Response.ContentType = "application/vnd.ms-excel";
Response.WriteFile(fileName);

However, this was opening the file in the same webpage and the back button was not having the desired effect of moving back to the initial page. After some attempts I found a simple way to get that to work correctly:

I declared a class

public class ExcelFile
{
public static string excelFileName;
}

set the static variable to the required filename, redirected the output to another page and used the same code in the page_load event:

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
Response.ContentType = "application/vnd.ms-excel";
Response.WriteFile(ExcelFile.excelFileName);
}

Monday, January 16, 2006

VMWare Player

I recently downloaded the latest version of VMWare WorkStation and there was this new utility called VMWare Player that was available for download. This was the coolest virtualization utility that I had ever encountered so far. There were options to open VMC (Microsoft Virtual PC machine configuration) files too. I tried running a couple of machines using that and they ran without any problems.
More information in this regard would be available at :

http://www.vmware.com/products/player/

Saturday, December 24, 2005

AJAX

I read quite a bit about AJAX lately and was amazed by the simplicity and the efficiency that it brought about in web applications. However I realized that this was not something new. The most interesting thing in this is the reduction of postbacks leading to improvement in performance.  About a couple of years back, one of my friends had shown me a online chat demo available at http://www.volano.com which implemented something like this.  The primary reason of the hype for AJAX seems to be because big players like Google have implemented it (gmail)  and there are other ambitious projects like WebOffice.

Tuesday, December 13, 2005

Memory leaks and Undisposed objects

Recently while working on a couple of issues related to memory leaks due to undisposed GDI objects, I came across this excellent post related to using tools to track down and eliminate memory leaks in managed code.

A couple of posts had a great sense of humor

A few good (performance) men
10 reasons why you should subscribe to my blog

Hats off to Rico Mariani.

Sunday, December 04, 2005

CompactFramework and Virtual Machines

I have worked for quite some time on Virtual machines and have also worked on CompactFramework in Dotnet. However I have never been able to run an emulator on a virtual machine using DotNET 1.x. There were many explanations that I had come across in this regard
1. There cant be two layers of virtualization.
2. The WinCE emulator uses the same engine as Virtual PC. (Both have been developed by Connectix). Virtual PC2004 and Virtual Server 2005 are based on this engine and so it is not able to run a copy of the emulator inside itself.

However I did some research on this and was not convinced with either of the reasons. VS.NET 2.0 (Whidbey) allows an emulator to be run from within a Virtual machine. The reason may be that this uses a different emulation engine. Also, when I had tried to run an emulator from a VMWare virtual machine, it failed to run on that too. I feel that I need to gain more gyan on this.
    

Gecko browsers and ASP.NET

ASP.NET has left me high and dry when I try to render web apps on a Gecko browser. I aint sure why this happens, but sometimes scrollbars appear on different parts of the browser, CSS styles appear to have taken a beating. I did a little googling on this and found out that it is not just ASP.NET but IIS also, which may be responsible for this.

The following modifications were suggested in the web.config file

< browserCaps >
< !--Gecko based browsers //-- >
< case match="^Mozilla/5\.0 \([^)]*\) (Gecko/[-\d]+)? (?'type'[^/\d]*)([\d]*)/(?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*)).*" >
browser="Gecko"
type=${type}
frames=true
tables=true
cookies=true
javascript=true
javaapplets=true
ecmascriptversion=1.5
w3cdomversion=1.0
css1=true
css2=true
xml=true
tagwriter=System.Web.UI.HtmlTextWriter
< case match="rv?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*))" >
version=${version}
majorversion=${major}
minorversion=${minor}
<case match="^b" with="${letters}" >
beta=true
</case>
</case>
</case>
</browserCaps>

There was another suggestion to use the following in the @page directive
clienttarget="IE5"