This repository was archived by the owner on Jun 20, 2025. It is now read-only.
Description Hi,
We need to use UI automation, and in order to run this code (just a simple example):
static void Main(string[] args)
{
AutomationElement currentProcessWindow =
AutomationElement.RootElement.FindAll(TreeScope.Children, Condition.TrueCondition)
.OfType<AutomationElement>()
.Single(a => a.Current.Name.Contains(Process.GetCurrentProcess().ProcessName));
Console.WriteLine(currentProcessWindow.Current.ControlType.ProgrammaticName);
}
we need to reference Microsoft.WindowsDesktop.App.Wpf :
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.WindowsDesktop.App.Wpf" />
</ItemGroup>
</Project>
This requires to install Desktop Runtime on the machine.
Regardless of the reason, is there a way to use UI automation without having to install Desktop Runtime?
Thanks.
Reactions are currently unavailable
Hi,
We need to use UI automation, and in order to run this code (just a simple example):
we need to reference Microsoft.WindowsDesktop.App.Wpf:
This requires to install Desktop Runtime on the machine.
Regardless of the reason, is there a way to use UI automation without having to install Desktop Runtime?
Thanks.