Question

I tried to get a simple example running to start the Windows calculator and do some things:

White: An UI Automation Tool for Windows Application

Saldy above link is old so I adapted the code from another example:

The White Windows UI automation getting started tutorial for testers

My simple code now looks like:

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");
        }
    }
}

I also added the WhiteCore.dll reference.

I still get an error:

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.

So there is something wrong with loading White.Core because of missing System.Web reference.

Any ideas? Is this a problem with my .NET installation?


Found a solution:

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

You have to change your .NET framework profile from .NET 4.0 Client to .Net 4.0 (full).

Was it helpful?

Solution

I think you need to add a reference to System.Web.dll to your project's references. If you cannot find it, then you might have to select a different framework profile.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top