1

On my Windows 7 workstation, I have a variety of compilers installed - including MSVC9 and MSVC10. I recently noticed the following strange problem which only occurs in my MSVC10 environment.

In my MSVC9 shell (I use the one from the start menu), running csc.exe shows that it's using the C# 2008 compiler version 3.5.30729.4926 (.NET 3.5). In the MSVC10 shell, it's compiler version 4.0.30128.1. Now, the following little sample program builds with csc.exe as of MSVC9, but it fails with MSVC10:

using System;
using System.Windows.Automation;

namespace UIAutomationTest
{
    class Program
    {
        static void Main()
        {
        }
    }
}

I use the following command line (with MSVC9 as well as MSVC10) to build the program:

csc Hello.cs /r:UIAutomationClient.dll /nologo

With MSVC9, this succeeds (no output is printed and Hello.exe is built). With MSVC10, the build fails with this error message:

C:\src>csc Hello.cs /r:UIAutomationClient.dll /nologo
error CS0006: Metadata file 'UIAutomationClient.dll' could not be found

Does anybody know why that is?

UPDATE: I noticed that I can make the build work with MSVC10 if I modify the command line so that /r:UIAutomationClient.dll becomes /r:WPF\UIAutomationClient.dll.

Frerich Raabe
  • 90,689
  • 19
  • 115
  • 207

1 Answers1

0

Where is this UIAutomationClient.dll file located relative to your cs files?

Try passing the full path of UIAutomationClient.dll.

logicnp
  • 5,796
  • 1
  • 28
  • 32