Core: UIAutomationClient.dll not found

Created on 30 Aug 2019  Â·  12Comments  Â·  Source: dotnet/core

Issue Title

UIAutomationClient.dll is not found in Reference Assemblies folder for .Net Core 3.0 Preview

General

I want to use System.Windows.Automation in my .Net Core 3.0 console application. When I try to reference UIAutomationClient.dll, i did not find the same in Reference Assemblies folder for .Net Core 3.0. Rather UIAutomationClient.xml is available on following folder
Reference Assemblies/Microsoft/Framework/.NETFramework/v4.X

.Net Framework folders have this UIAutomationClient.dll. i.e. 4.8, 4.7.2 etc..

Am I looking at the wrong place or I need to do something different in .Net Core 3.0 application?

Project Type : .Net Core 3.0 Console Application
Required Namespace : System.Windows.Automation
Required Dll for Reference : UIAutomationClient.dll
Using VS 2019 version 16.3 Preview2
.Net Core SDK version 3.0 Preview8

Most helpful comment

What if you need to reference UIAutomation in a program which is not a Desktop app and does not use WPF? Is there a reliable way to ref it besides copying over dlls?

All 12 comments

@vatsan-madhavan - Any plans to bring automation to Core?

PS C:\Program Files (x86)\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\3.0.0-preview8-27908-02\ref\netcoreapp3.0> dir ui*.*                                                                                                                    

    Directory: C:\Program Files
    (x86)\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\3.0.0-preview8-27908-02\ref\netcoreapp3.0


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----          7/6/2019   9:06 PM          35704 UIAutomationClient.dll
-a----         6/14/2019  12:26 PM         184761 UIAutomationClient.xml
-a----          7/6/2019   9:06 PM          15224 UIAutomationClientSideProviders.dll
-a----         6/14/2019  12:25 PM            587 UIAutomationClientSideProviders.xml
-a----          7/6/2019   9:06 PM          21880 UIAutomationProvider.dll
-a----         6/14/2019  12:26 PM          63392 UIAutomationProvider.xml
-a----          7/6/2019   9:06 PM          28024 UIAutomationTypes.dll
-a----         6/14/2019  12:26 PM         105496 UIAutomationTypes.xml

PS C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App\3.0.0-preview8-27908-02> dir ui*.*                 

    Directory: C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App\3.0.0-preview8-27908-02


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----          7/8/2019   2:44 PM         367992 UIAutomationClient.dll
-a----          7/8/2019   2:44 PM         783736 UIAutomationClientSideProviders.dll
-a----          7/8/2019   2:44 PM          46968 UIAutomationProvider.dll
-a----          7/8/2019   2:44 PM         268664 UIAutomationTypes.dll

It's all there.

@ms0713, Are you using a WindowsDesktop SDK project (Use dotnet new wpf to see an example of one)?

Closing due to thread going stale. Please reopen if you're still having troubles.

PS C:\Program Files (x86)\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\3.0.0-preview8-27908-02\ref\netcoreapp3.0> dir ui*.*                                                                                                                    

    Directory: C:\Program Files
    (x86)\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\3.0.0-preview8-27908-02\ref\netcoreapp3.0


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----          7/6/2019   9:06 PM          35704 UIAutomationClient.dll
-a----         6/14/2019  12:26 PM         184761 UIAutomationClient.xml
-a----          7/6/2019   9:06 PM          15224 UIAutomationClientSideProviders.dll
-a----         6/14/2019  12:25 PM            587 UIAutomationClientSideProviders.xml
-a----          7/6/2019   9:06 PM          21880 UIAutomationProvider.dll
-a----         6/14/2019  12:26 PM          63392 UIAutomationProvider.xml
-a----          7/6/2019   9:06 PM          28024 UIAutomationTypes.dll
-a----         6/14/2019  12:26 PM         105496 UIAutomationTypes.xml

PS C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App\3.0.0-preview8-27908-02> dir ui*.*                 

    Directory: C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App\3.0.0-preview8-27908-02


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----          7/8/2019   2:44 PM         367992 UIAutomationClient.dll
-a----          7/8/2019   2:44 PM         783736 UIAutomationClientSideProviders.dll
-a----          7/8/2019   2:44 PM          46968 UIAutomationProvider.dll
-a----          7/8/2019   2:44 PM         268664 UIAutomationTypes.dll

It's all there.

You cant refer it in .Net Core Console Application. Thats limitation.

@ms0713, Are you using a WindowsDesktop SDK project (Use dotnet new wpf to see an example of one)?

This is working. Thanks!

@vatsan-madhavan
I installed the latest rc1. Have the same issue. Can't manually reference the assembly due to the following error:
Screen Shot 2019-09-18 at 11 33 06 AM

Below is a portion of .csproj file:

<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
 <Configurations>EndToEndWithFake;EndToEndWithReal;IntegrationWithFake;IntegrationWithReal</Configurations>
    <UseWpf>true</UseWpf>
  </PropertyGroup>

Can't manually reference the assembly

@godrose What do you mean by that, exactly?

Did you use Visual Studio's _Reference Manager_ dialog to browse to the location of UIAutomation.dll reference assembly (for e.g., something like C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\3.0.0-rc2-19460-02\ref\netcoreapp3.0\UIAutomation.dll) and try to add that as a reference in your .NET Core WPF project - like this ?

image

If my guess is correct, then you can't do that.

All WPF assemblies are already implicitly referenced automatically when using Microsoft.NET.Sdk.WindowsDesktop - you don't have to do anything. This includes UIAutomation.dll.

One caveat - there is currently a bug in .NET Core 3.0 that excludes theme assemblies from being referenced automatically - see https://github.com/dotnet/wpf/issues/765. We plan to fix it in .NET Core 3.1.

Thanks for the quick response. The only way I could make this work was
copying the dll manually. I see this as a regression .

On Wed, 18 Sep 2019 at 23:42 Vatsan Madhavan notifications@github.com
wrote:

Can't manually reference the assembly

@godrose https://github.com/godrose What do you mean by that, exactly?

Did you use Visual Studio's Reference Manager dialog to browse to the
location of UIAutomation.dll reference assembly (for e.g., something like C:Program
FilesdotnetpacksMicrosoft.WindowsDesktop.App.Ref3.0.0-rc2-19460-02refnetcoreapp3.0UIAutomation.dll)
and try to add that as a reference in your .NET Core WPF project - like
this ?

[image: image]
https://user-images.githubusercontent.com/20246435/65184214-e7d45280-da19-11e9-90f4-56c0d84f8a1a.png

If my guess is correct, then you can't do that.

All WPF assemblies are already implicitly referenced automatically when
using Microsoft.NET.Sdk.WindowsDesktop - you don't have to do anything.
This includes UIAutomation.dll.

One caveat - there is currently a bug in .NET Core 3.0 that excludes theme
assemblies from being referenced automatically - see dotnet/wpf#765
https://github.com/dotnet/wpf/issues/765. We plan to fix it in .NET
Core 3.1.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dotnet/core/issues/3283?email_source=notifications&email_token=AB3OIIYBZJ2NWXSYOHCIIADQKKHETA5CNFSM4ISMIKOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7BME6I#issuecomment-532857465,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB3OII34KASFH4JJMTWXI6DQKKHETANCNFSM4ISMIKOA
.

>

Best Regards,
Gena

Thanks for the quick response. The only way I could make this work was copying the dll manually. I see this as a regression .

Would you explain your scenario better, possibly with a self-contained minimal repro project attached? I'm not quite following what you are trying to do that requires you to copy UIAutomationClient.dll manually, or browse to it and add a reference to it using the Visual Studio Reference Manager.

Given the fact that UIAutomationClient.dll is implicitly referenced by all Microsoft.NET.Sdk.WindowsDesktop projects when <UseWPF>true</UseWPF> is set in the project, such projects would get a reference to it automatically without needing any additional work. If you are having to do more here, I'd like to understand your scenario better.

What if you need to reference UIAutomation in a program which is not a Desktop app and does not use WPF? Is there a reliable way to ref it besides copying over dlls?

You can use a FrameworkReference to Microsoft.WindowsDesktop.App.Wpf from a console app and get references to WPF assemblies (which includes UIA* assemblies).

Was this page helpful?
0 / 5 - 0 ratings