2013-02-22 41 views
0

我试图让运行来启动Windows计算器一个简单的例子,做一些事情:白UI自动化C#装载White.Core汇编失败

White: An UI Automation Tool for Windows Application

Saldy上面的链接是旧的,所以我适应代码从另外一个例子:

The White Windows UI automation getting started tutorial for testers

我简单的代码现在看起来像:

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Web; 
using White.Core; 
using White.Core.UIItems; 
using White.Core.UIItems.WindowItems; 
using White.Core.UIItems.WindowStripControls; 
using White.Core.UIItems.MenuItems; 
using White.Core.UIItems.TreeItems; 
using White.Core.UIItems.Finders; 

namespace TestWhiteCalculator 
{ 
    class Program 
    { 
     static void Main(string[] args) 
     { 
      Application manager = Application.Launch(@"C:\Windows\system32\calc.exe"); 

      Window mainWindow = manager.GetWindow("Rechner"); 
     } 
    } 
} 

我还添加了WhiteCore.dll参考。

我仍然得到一个错误:

Warning: The referenced assembly "White.Core" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project.

所以有什么问题,因为缺少System.Web参考加载White.Core

任何想法?这是我的.NET安装问题吗?


找到了解决办法:

System.Web assembly is not found on .net 4.0 version

你必须从.NET 4.0客户端更改.NET框架轮廓.NET 4.0(满)。

回答

1

我认为你需要在项目的参考文献中增加对System.Web.dll的引用。如果你找不到它,那么你可能需要select a different framework profile

+0

jep框架是问题http://stackoverflow.com/questions/7694380/system-web-assembly-is-not-found-on-net-4-0-version – Dukeatcoding 2013-02-22 12:26:30