Search This Blog

November 21, 2008

VSTS 2008 Web Test and Windows Authentication Login Popup

You are a user (Domain A\Ray) in domain A. If you use VSTS 2008 web test to test the URL in domain B, IE 7 will have the Windows Authentication login popup to remind you of entering the username (Domain B\Ray) and password in domain B. You will see the login popup as follows:

The server XXX.XXX.com at XXX.XXX.com requires a username and password.

After you enter your username and password, the web test moves on and finally makes your test fail. When you see the test result, you find one of the requests is: You are not authorized to view this page.

After you generate the codes and find that VSTS 2008 doesn’t record the username and password you just entered. How can you handle this situation?

You need to add the following source codes.

this.UserName = "abc\raylin";
this.Password = “12345”;


After you add them and if the test case still fails, please check if you install VSTS 2008 SP1. You might also need to add the proxy in your source codes too. You will make your test case pass.

November 18, 2008

VSTS 2008 Web test-The remote name could not be resolved

If you use VSTS 2008 to do the web test, you might have one issue- the remote name could not be resolved. It is hard to say what makes your web test case failed.

When I have this issue, I always think it is the proxy issue. When I add the following source code, it works all the time.

this.Proxy = “XXX.XXX.com";

October 26, 2008

VSTS 2008 web test recorder bar does not show up

During this month, I have used VSTS 2008 web test to create more than 200 automated tests in my current Microsoft Project without any problem. The test automation runs very smoothly every day.

Today I used my personal PC in my house to create one simple automated test. Unluckily, the recorder bar didn’t show up. My PC environment is as follows:

Windows XP SP3, IE 7, VSTS 2008 SP1.

I finally found that my Microsoft Web Test Recorder was disabled. Only what I needed to do was launch IE 7, go to Internet Options/Programs/Manage Add-ons and enable Microsoft Web Test Recorder.

After that, the issue was fixed. I could create the simple web test successfully.

August 11, 2008

VSTS 2008 could not load file or assembly Interop.SHDocVw

Today I downloaded WatiN (Web application test in .Net) tools and wanted to run the web test using Visual Studio .Net 2008. I got the following error:

Could not load file or assembly 'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

If you see this in the future, it is easy to fix it. You can just go to C:\Windows\System32 and copy shdocvw.dll to the bin directory of your current project.

Open your Visual Studio project, add shdocvw.dll in your references and run the test again. The problem will be disappeared.

August 9, 2008

Always install SQL Server 2008 RTM first before you install Visual Studio 2008

If you have Visual Studio 2008 and Visual Studio 2008 SP1 Beta on your PC, and then you want to install SQL Server 2008 RTM, you might have the following error.

A previous release of Microsoft Visual Studio 2008 is installed on this computer. Upgrade Microsoft Visual Studio 2008 to the SP1 before installing SQL Server 2008.
(see : http://support.microsoft.com/kb/956139)

That’s because you have Visual Studio 2008 SP1 Beta on your PC, not Visual Studio 2008 SP1. If you don’t have SP1, you can’t install it successfully. Today is August 9, and we need to wait until Microsoft releases Visual Studio 2008 SP1.

If you really want to install SQL Server 2008 RTM now, you need to uninstall Visual Studio 2008 and SP1 , install SQL Server 2008 RTM and then reinstall Visual Studio 2008. When Visual Studio 2008 SP1 is released, you can install it later.

The lesson I learn :
Always install SQL Server 2008 RTM first before you install Visual Studio 2008 +SP1

Microsoft doesn’t support upgrading from SQL Server 2008 RC0 to SQL Server 2008 RTM

If you have SQL Server 2008 RC0 and Visual Studio 2008 SP1 Beta on your PC and then you want to upgrade to SQL Server 2008 RTM, You may feel disappointed.

At this moment, Microsoft doesn’t support upgrading from SQL Server 2008 RC0 to SQL Server 2008 RTM.

You need to uninstall SQL Server 2008 Beta and Visual Studio 2008 SP1 Beta first and then install SQL Server 2008 RTM.

Will it change in the future??

August 8, 2008

The installation package cannot be installed by the installer service

SQL Server 2008 RTM is released now. Today I used my Windows Server 2008 PC to download SQL Server 2008 Books Online (SQLServer2008_BOL.msi). I tried to install it, but it had the following message.

The installation package cannot be installed by the installer service. You must install a windows service pack that contains a newer version of the windows installer service.

This message showed that I didn’t have Windows Installer. After I installed Windows Installer 4.5 Redistributable (Windows6.0-KB942288-v2-x86.msu), everything was fine.

July 20, 2008

How to upgrade to SQL Server 2008 RC0?

If you have SQL Server 2000, SQL Server 2005 or SQL Server 2008 Feb CTP on your PC and then if you want to upgrade to SQL Server 2008 RC0, on the UI side, you only can see the link which can let you upgrade from SQL Server 2000 or 2005 to SQL Server 2008 RC0.

How do you upgrade from SQL Server Feb CTP to SQL Server 2008? I would like to say that you can click the above link to try if the upgrade is working. I believe this link also supports Build-to-Build upgrade.

If you don’t want to use UI to do the upgrade, you can also use the command line to do the upgrade as follows:

setup.exe /ACTION=Upgrade /INSTANCENAME=yourInstancename

After entering the command line, you will know how to upgrade to SQL Server 2008 RC0.

July 17, 2008

Microsoft Office Communicator 2007 doesn’t support Windows Server 2008

Today when I wanted to install Microsoft Office Communicator 2007 on my PC with Windows Server 2008, I found the install had no UI. The black console showed up quickly and then disappeared.

The UI showed the error messages with the incomplete install and the complete install , which made me feel confused. Did it mean that the install is incomplete or complete? Actually there was no real install.

Finally I found that Microsoft Office Communicator 2007 only supports the operating systems: Windows 2000 SP4, Windows XP SP2, Windows Vista. Therefore , I can't use Microsoft Office Communicator 2007 on Windows Server 2008.

Will it change in the future?

July 14, 2008

Can’t you install SQL Server 2005 tools after you install VSTS 2008?

If you install VSTS 2008 first successfully on your PC and then if you install SQL Server 2005 with default instance later, you might get the dialogue box saying that you can’t install SQL Server 2005 Tools (Workstation Components, Books Online and Development Tools) . If you try to install SQL Server 2005 tools with named instance, it is not working either. You may feel disappointed.

That’s because when you install VSTS 2008, you also install SQL Express automatically, which blocks you to install SQL Server 2005 tools.

Don’t worry. You can just do the following steps:

1. Go to Add/Remove Programs

2. Choose Microsoft SQL Server 2005.

3. Uninstall Workstation Components, Books Online and Development Tools.

4. Install SQL Server 2005 Tools again.

You will fix the problem.

July 13, 2008

Use CCleaner to remove the software you can’t uninstall in Add/Remove Programs

Today I wanted to uninstall some software like Muddly (Browser) and CA eTrust in my Add/Remove Programs (ARP) . But I couldn’t find change/remove button to uninstall them. I tried to use some online uninstall software to remove them, but they were not helpful. Finally, I found CCleaner helped me uninstall them successfully.

If you uninstalled some software before , but you can still see them in ARP, you can try CCleaner this time.

After you download CCleaner, you can launch it, go to Tools and click Run Installer. You will find it is so powerful to remove the programs so easily.

Article:
Use CCleaner and Uninstall Tool in your PC every day

July 6, 2008

CanoScan error: Make sure that there is enough space on the target disk

I have used my scanner, CanoScan LiDE 70, to scan documents without any problem since 2006. Today when I used it, I got the following error message :

Unable to scan: Make sure that there is enough space on the target disk.

This error message was not helpful because my target disk still had so much space. When I changed the default setting to another disk, it still showed the error. When I rebooted my PC, I still got this error too.

When I was surfing some forums, I could not get the correct answer. The best way for me in my mind was to uninstall CanoScan LiDE 70 driver and install it again to see what’s going on.

After the uninstall and install CanoScan LiDE 70 driver, there is no error message. It is working for me.

If you get this error message next time, just uninstall it and install it again. It might work for you.

June 29, 2008

SQL Server 2008 RC0 BIDS and SQL Server 2005 BIDS can do the side by side install

This Feb, I wrote an article (Installing SQL Server 2008 BIDS (CTP6)) about SQL Server 2008 BIDS (CTP6) and got the important result as follows:

Either SQL Server 2008 BIDS or SQL server 2005 BIDS is allowed when you do the side by side install of SQL Server 2008 and SQL server 2005.

Some days ago, I installed SQL Server 2008 RC0 on my Windows XP machine with SQL Server 2005 (full install) and VSTS 2008 .

I find SQL Server 2008 RC0 BIDS and SQL Server 2005 BIDS can do the side by side install. The result is very different from the one in SQL Server 2008 CTP6.

Per msdn, SQL Server Management tools include the following components:

SQL Server Management Studio

SQL Server Profiler

SQL Server Database Tuning Advisor

Command prompt tools, such as sqlcmd.exe and osql.exe.

Business Intelligence Development Studio add-ins to Microsoft Visual Studio

Note that Business Intelligence Development Studio is a separate option during SQL Server installation.

Regardless of how many instances of SQL Server, Analysis Services, or Reporting Services are installed on a computer, only one copy of SQL Server 2008 Management Tools will be installed.

SQL Server 2008 Management Tools can run side-by-side on the same computer with earlier versions of SQL Server Management Tools.

SQL Server 2008 BIDS is really an interesting issue and I don’t know if it will be changed in the version of SQL Server 2008 RTM.

VS 2008 Shell, Visual Studio Tools for Applications and SQL Native Client are Redists

I tried the simple scenario on my VM Win2k3 as follows:

1. Install SQL Server 2008 RC0 (full install)

2. Uninstall SQL Server 2008 RC0 (full uninstall)

After the full uninstall of RC0, I can still see VS 2008 Shell, Visual Studio Tools for Applications and SQL Native Client on Add/Remove Programs. Those components are Redists. Therefore, after the uninstall, other software still need them.

It is so interesting to know this scenario.

June 25, 2008

SQL Server 2005 can’t be upgraded to SQL Server 2008 RC0 at this moment

When you have SQL server 2005 Enterprise in your PC, and you want to upgrade to SQL Server 2008 RC0, you will find the upgrade fails. That’s because the current SKU of SQL Server 2008 RC0 is Enterprise Evaluation, not Enterprise.

It is impossible for you to upgrade from SQL server 2005 Enterprise to SQL Server 2008 RC0 Enterprise Evaluation. We need to wait until SQL Server 2008 RTM Enterprise is released.

The only thing you can do is install previous SQL Server 2008 CTP first and then upgrade it to SQL Server 2008 RC0. The upgrade will pass.

June 15, 2008

Need to install VSTS 2008 SP1 if your web test and proxy setting fails in VSTS 2008

I posted the issue in the following forum.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3486137&SiteID=1

I try to create a web test using proxy, and the following codes are working in VSTS 2005, but it is not working in VSTS 2008. I got the following error:

Request failed: No connection could be made because the target machine actively refused it IP Address:80

During 1 day search and I find one clean machine to repro, I find the problem .

VSTS 2008 RTM has the bug related to webtest and proxy. That's why it failed in VSTS 2008 RTM , but passed in VSTS 2005.

Because VSTS 2008 SP1 Beta is still in beta version, usually people don't install it. If they don't install it, it means this web test and proxy will not work forever.

After I installed it and ran the test again, the web test passed.

using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using Microsoft.VisualStudio.TestTools.WebTesting;

public class WebTest3Coded : WebTest
{
public WebTest3Coded()
{
this.PreAuthenticate = false;
NetworkCredential credential;
credential = (NetworkCredential)CredentialCache.DefaultCredentials;
WebProxy proxy = new WebProxy("198.152.203.10", 80);
proxy.Credentials = credential;
this.WebProxy = proxy;
}
public override IEnumerator GetRequestEnumerator()
{
WebTestRequest request1 = new WebTestRequest("http://www.microsoft.com/");
yield return request1;
}
}

April 9, 2008

How to Merge Two Arrays Using C#?

Today I went to the following forum and found someone was asking the question about how to merge two arrays using C#.

http://forums.asp.net/t/1229678.aspx

This question is interesting. Therefore, I spent some time writing source codes using C# as follows. If you want to merge 2 arrays and meet your need, you may try to extend the function.

static public void MergeMultiDimensionArray()
{

int i, j,k,m,p,q;
int[,] array1 = { { 1, 2, 3 }, { 4, 5, 6 } };
int[,] array2 = { { 7, 8, 9 }, { 10, 11, 12 } };
int[,] mergeArray = new int[array1.GetLength(0) + array2.GetLength(0), array2.GetLength(1)];

for (i = 0; i < array1.GetLength(0); i++)
{
for (j = 0; j < array1.GetLength(1); j++)
{
mergeArray[i,j] = array1[i,j];
}

}

for (k = 0; k < array2.GetLength(0); k++)
{
for (m = 0;m< array2.GetLength(1); m++)
{
mergeArray[i, m] = array2[k, m];


}

i++;

}

for (p = 0; p < mergeArray.GetLength(0); p++)
{
for (q = 0; q < mergeArray.GetLength(1); q++)
{
Console.WriteLine(mergeArray[p, q]);
}

}


}

March 26, 2008

Successful upgrade from Windows Vista to Windows XP

I bought a new Gateway PC with Windows Vista Home Premium Version last September. During this period, I have installed lots of software such as Adobe products, Visual Studio .NET 2005, SQL Server 2005, Office 2007, Google and yahoo products. When I ran the program on Windows Vista, the response time was so slow and made my PC down. I needed to use task manager to end the program. If it didn’t work, I needed to reboot my PC. Finally, I made a decision to downgrade from Windows Vista to Windows XP.


Before I did the downgrade, I found that Gateway didn’t give me all drivers inside the CD. I went to http://www.gateway.com/ and found it was not helpful. I called their technical support and that woman said,” If you want to do the downgrade, you will break your warranty. We don’t do it over the phone. ” I was not satisfied with her answer.


Heaven helps those who help themselves. I wanted to give it a try. After I installed Windows XP with SP2, Office 2007 and lots of software, I found that some drivers were missing. Finally I found ccleaner.com has the small program that can check my PC. It was really helpful because it checked how many drivers I needed in my PC and made me download.


After I downloaded them and installed them, I still found l needed one more audio driver. Without it, I couldn’t play MP3. Finally I found the driver, High Definition Audio, in realtek.com. After I installed it, I could play MP3.


Now when I launch so many programs on Windows XP machine ,the speed is really faster than Vista’s. I want to say: I successfully “upgrade” from Windows Vista to Windows XP.

March 20, 2008

The error of Web Application Stress Tool : MSVCP50.dll was not found

If you install Web Application Stress Tool on Windows Vista, you might have the following error.

The application has failed to start because MSVCP50.dll was not found. Re-installing the application may fix the problem.

You need to download msvcp50.DLL and put it in c:\windows\system32 folder.

After that, just run setup.exe. It should work.

March 17, 2008

Microsoft provides an excellent website of virtual labs

We know that Microsoft has so many products. How can you get familiar with all of them very well unless you are a super man?

If your work can let you get familiar with all Microsoft products, your company must be very excellent. Per the job descriptions posted on Dice, CareerBuilder or Monster, you probably feel frustrated because some companies need more experienced candidates with different technical skills in different products. I think it is hard for them to find those people.

Everything starts from zero. If you don’t know one of Microsoft products now, you can just go to the following website.

http://msdn2.microsoft.com/en-us/virtuallabs/default.aspx

You can register online, download the individual lab manual and make some practice. You will improve your skills gradually.

March 16, 2008

I like Google Reader

Everyone knows that blogs are very popular now. If you want to see your friends’ blogs, but these are in different websites, how can you access them easily? Do you want to open your browser and go to the individual website? It is not smart to do so.

Google Reader provides a good way for bloggers to read people’s blogs easily. You just login to www.google.com/reader using your username and password. You can add subscription by typing the URL of friend’s blog individually. Next time you can read them easily. I like Google Reader.

March 13, 2008

Google provides the excellent search function of free ebooks

If I find some IT books such as Visual Studio.NET 2008, C# 3.0, WPF, WCF, or SQL Server are excellent in Barnes and Nobles, do you think I will buy them soon? The answer is no.

I will go back to my apartment, open my notebook, go to Google main page and enter the name of the book title. I will see lots of websites provide free ebooks and I can download them easily. Why should I buy these expensive books? Google really provides the excellent search function of free ebooks.

February 13, 2008

WCF Contracts

Today I was surfing Microsoft E-Learning, I learned WCF has 5 contracts as follows:

1. Service contract

A service contract defines the operations that a service supports, and maps to a portType in Web Service Description Language (WSDL). Service contracts are implemented as .NET Framework interfaces that are annotated with the ServiceContract attribute.

[ServiceContract]
public interface IMyContract { ...}

2. Operation contracts

Operation contracts define the individual operations that a service supports and map to operations in WSDL. Operations are defined by adding methods to a Service Contract interface that is annotated with the OperationContract attribute.

[OperationContract]
void SomeOperation();

3. Data contracts
Data contracts define how complex types are serialized when they are used in WCF service operations. They are defined by applying the DataContract and DataMember attributes to classes.

[DataContract]
public class SomeType{ [DataMember] public int ID;}

4. Message contracts
Message contracts describe the entire SOAP message format. They can use data contracts and serializable types to emit schema for complex types, and they also make it possible to control the SOAP message headers and body explicitly, by using a single type. Message contracts provide a simple method to add custom SOAP headers to incoming and outgoing messages.

[MessageContract]
public class MyRequest {
[MessageHeader] public string field1;
[MessageBody] public string field2;
}

5. FaultContract
WCF service reports errors by using Fault objects. Fault contracts document the errors that WCF code is likely to produce, and WCF maps Fault objects to SOAP faults. Note that the type specified in the FaultContract does not have to be an exception, although it often will be.

[OperationContract]
[FaultContract(typeof(DivideByZeroException))]
void SomeMethod();

A Fault is generated by throwing a FaultException:

throw new FaultException<DivideByZeroException>(

The Process of Implementing a Service Contract
The following code example shows how to define a WCF service contract by using a .NET Framework interface. The ServiceContract attribute is applied to the interface, and each of the methods defined in the interface has the OperationContract attribute applied to it. Note that any methods that are not marked with OperationContract are not visible to clients.

[ServiceContract]
public interface IOrderService
{
[OperationContract]
void CreateOrder(int orderNumber);

[OperationContract]
void AddItemToOrder(int orderNumber, Item itm);

[OperationContract]
Order GetOrderDetails(int orderNumber);
}

The following code example shows how to implement a WCF service contract by using a .NET Framework class that implements a service contract interface. Note that the implementing class does not require any special attributes.

public class OrderService : IOrderService
{
void CreateOrder(int orderNumber)
{
// implementation details
}

void AddItemToOrder(int orderNumber, Item itm)
{
// implementation details
}

Order GetOrderDetails(int orderNumber)
{
// implementation details
}
}

The following code example shows how to implement a WCF data contract. The DataContract attribute is used to define a data contract class and DataMember attributes define the class members that take part in the contract.

[DataContract]
public class Order
{
[DataMember]
public int OrderNumber;
[DataMember]
public String ClientName;
...
}

Do you think it is a good interview question ?

February 5, 2008

Installing SQL Server 2008 BIDS (CTP6)

If you have SQL server 2005 BIDS in your PC, and then if you install SQL Server 2008 CTP 6, the install will skip the installation of SQL Server 2008 BIDS.

If you don’t have SQL Server 2005 BIDS in your PC, and then if you install SQL Server 2008 CTP 6, SQL Server 2008 BIDS will be installed in your PC.

If you have SQL Server 2008 BIDS in your PC, and then you uninstall SQL Server 2008 BIDS, installing SQL server 2005 BIDS must work.

Either SQL Server 2008 BIDS or SQL server 2005 BIDS is allowed when you do the side by side install of SQL Server 2008 and SQL server 2005.

Do you think BIDS is interesting?

January 16, 2008

Before upgrading from Windows XP / Win2k3 to Windows Vista/ Windows Server 2008, we need to uninstall Windows Powershell first

Today I find one interesting issue. If you have Windows Powershell install on Windows XP / Windows Server 2003 and if you want to upgrade to Windows Vista / Windows Server 2008, the upgrade wizard will tell you that you need to uninstall Windows Powershell first. Where can you uninstall Windows Powershell?

















There are 2 ways to do so. One is to go to Add or Remove Programs, select “show updates”, and you can uninstall it.















The other one is to go to C:\WINDOWS\$NtUninstallKB926139$\spuninst, double click spuninst.exe, and then you can uninstall it. You can also use the command line to uninstall Windows Powershell as follows:
C:\WINDOWS\$NtUninstallKB926139$\spuninst\ spuninst.exe /q

After the upgrade, Windows Powershell is not installed on windows Vista / Windows Server 2008. If you still need it, you need to install it again.
















For Windows Vista, you need to download Windows Powershell Vista version in Microsoft website.

For Windows Server 2008, Windows Powershell is part of the windows components. You can see use the following command line to install it.

ServerManagerCmd.exe /install PowerShell

Do you think Windows Powershell is an interesting issue?

Using command lines to turn off/on UAC on Windows Vista

I know lots of people hate UAC and want to turn it off on Windows Vista. You can just write the command line to turn off/on UAC and reboot your PC. How to do it?

Turn off UAC:

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

Turn on UAC:

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f

Reboot: shutdown –r

After you run UAC and reboot command lines, your PC will cause reboot automatically. Everything will be fine. Is that easy for you?

January 13, 2008

3 failed login attempts block your account—a good idea?

If you go to some famous online websites, you need to login to your account using your username and password. But if you use the wrong password to login 3 times, your account will be blocked. You need to call the customer service representative and get the new password to login again. Is it a good idea to set the policy of 3 failed login attempts?

Just imagine this situation. If a hacker is very familiar with using the tool to try different username and password during 2 hours in ABC Company, do you think it is easy for him to block other people’s accounts? Do you think the account owners will blame ABC Company?

January 9, 2008

SQL Server 2005: Data files are always under MSSQL.n\MSSQL\Data folder

If you use UI or command line to install SQL server 2005, data files are placed under MSSQL.n\MSSQL\Data .

If you specify INSTALLSQLDATADIR=”C:\mydata” and try to put data files under mydata folder, you probably feel disappointed.

After the install, it generates the path MSSQL.1\MSSQL\Data and attaches it to the above path; finally it becomes: “C:\mydata\MSSQL.1\MSSQL\Data”.

From this article (http://msdn2.microsoft.com/en-us/library/ms345408.aspx), master and resource DBs must be in the same location:

The Resource database depends on the location of the master database. If you move the master database, you must also move the Resource database to the same location as the master data file. Do not put the Resource database in either compressed or encrypted NTFS file system folders. Doing so will hinder performance and prevent upgrades.

Do you think it is an interesting issue?