C# 引用 System.Windows.Automation
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1469386/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
referencing System.Windows.Automation
提问by tbischel
I wanted to try out some of the automation stuff available through BugSlayer, but am having problems with the references.
我想尝试一些通过BugSlayer可用的自动化内容,但在引用方面遇到了问题。
I'm trying to figure out how to reference the System.Windows.Automation library in visual studio. I have the .NET Framework v3.5 installed, and VS 2008, but neither the UIAutomationClient nor System.Windows.Automation appear as a reference option in either the .NET or COM tabs for the references.
我想弄清楚如何在 Visual Studio 中引用 System.Windows.Automation 库。我安装了 .NET Framework v3.5 和 VS 2008,但 UIAutomationClient 和 System.Windows.Automation 都没有作为参考选项出现在 .NET 或 COM 选项卡中以供参考。
I can see the dll if I navigate to C:\WINDOWS\assembly\GAC_MSIL\UIAutomationClient\3.0.0.0__31bf3856ad364e35
through the command prompt, but if I browse to the assembly in Visual Studio, I can't actually get to the dlls.
如果我C:\WINDOWS\assembly\GAC_MSIL\UIAutomationClient\3.0.0.0__31bf3856ad364e35
通过命令提示符导航到 dll,我可以看到 dll ,但是如果我在 Visual Studio 中浏览到程序集,我实际上无法访问 dll。
Have I overlooked a simple way to include this in my project?
我是否忽略了将其包含在我的项目中的简单方法?
采纳答案by Graviton
The UIAutomationClient.dll
is located in this folder:
将UIAutomationClient.dll
位于此文件夹中:
C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0
If you can't find in your Add Reference->.Net
tab, then you have to use the Browse
tab to go to the given path, and add the assembly (Right Click on the References
, choose add reference
, click browse
tab).
如果在Add Reference->.Net
选项卡中找不到 ,则必须使用Browse
选项卡转到给定路径,然后添加程序集(右键单击References
,选择add reference
,单击browse
选项卡)。
回答by sharmila
add Uiautomationclient dll present under .net tab
添加存在于 .net 选项卡下的 Uiautomationclient dll
回答by Steve Greene
I'm using Visual Studio Express 2015, and targeting to .NET 4.5. None of the answers worked for me. Here's what I had to do (after many minutes of looking through Add References -> Assemblies -> Framework and playing around. The reference I added is "UIAutomationClient". (There isn't any System.Windows.Automation" assembly in my list. Note that I also see assemblies "UIAutomationProvider", "UIAutomationTypes", and "UIAutomationClientsideProviders", but I didn't try any of those.)
我使用的是 Visual Studio Express 2015,目标是 .NET 4.5。没有一个答案对我有用。这是我必须做的事情(经过几分钟的查看添加引用 -> 程序集 -> 框架并四处玩耍。我添加的引用是“UIAutomationClient”。(我的列表中没有任何 System.Windows.Automation”程序集. 请注意,我还看到了程序集“UIAutomationProvider”、“UIAutomationTypes”和“UIAutomationClientsideProviders”,但我没有尝试其中任何一个。)
Anyway, once I got the reference to "UIAutomationClient" added, then the using System.Windows.Automation
actually worked okay.
无论如何,一旦我添加了对“UIAutomationClient”的引用,那么using System.Windows.Automation
实际上工作正常。
回答by the.net-learner
In VS 2015, you need to reference the UIAutomationProvider dll to use this Provider namespace. Just add a reference to this dll in your references folder. It's available in the Framework Assemblies of .NET.
在 VS 2015 中,您需要引用 UIAutomationProvider dll 才能使用此 Provider 命名空间。只需在您的引用文件夹中添加对此 dll 的引用。它在 .NET 的框架程序集中可用。