Jul 9, 2008 at 7:47 AM
Edited Jul 9, 2008 at 7:51 AM

I'm trying to use this code below ~

SearchCriteria searchCriteria = SearchCriteria.ByControlType(typeof(Window)).AndIndex(0);

I'm getting the following error. Yes. This is a compile-time error.

Error    1    The type 'System.Windows.Automation.ControlType' is defined in an assembly that is not referenced. You must add a reference to assembly 'UIAutomationTypes, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.    C:\Michael Sync\Labs\WPFApp1\WPFApp1.Test\Window1Test.cs    61    13    WPFApp1.Test

How can I solve this problem?

I have already tried the following :

1) SearchCriteria searchCriteria = SearchCriteria.ByAutomationId("ddd").AndControlType(typeof(Window)).AndIndex(0); does't give me the compile-time error.

2) I tried to add UIAutomationClient as a reference in my test project but I'm still getting the error.

I'm using VS 2008.

Jul 9, 2008 at 2:40 PM
May be you need UIAutomationTypes.dll
Jul 10, 2008 at 1:44 AM

viveksingh wrote:
May be you need UIAutomationTypes.dll

Thanks a lot.
Aug 5, 2008 at 6:13 PM
i cant found the file UIAutomationTypes.dll
Aug 5, 2008 at 11:52 PM
If you are using VS 2008, that dll is in .NET Reference dialog.