3

I've added a reference to Interop.WUApiLib in my project, a console application. I'm trying to test out silently running updates on virtual machines but its not going so well. When I try to run the console app, it immediately crashed with the following error:

Unhandled Exception: System.IO.FileNotfoundEXception: Could not load file or assembly 'Interop.WUApiLib, Version=2.0.0.0, Culture=nuetral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'Iterop.WUApiLib, Version=2.0.0.0, PublicKeyToken=null' at WindowsUpdateconsoleTest.Program.Main(String[] args)

I've checked the version on wuaueng1.dll and its 5.3.3790.5512, so WUA should be installed. I'm developing on Windows 7, the virtual machines are on Windows XP Service Pack 3. My local machine(which appears to run it fine is on a later version of wuapi.dll). Is that the issue? Or is something else going on?

I would really like to not have to call powershell scripts on these machines if I can avoid it.

Thomas
  • 152
  • 1
  • 2
  • 8
  • It can't load the DLL. You need to have the DLL location in your `PATH` variable on Windows, or copy/paste the DLL into the output folder of your application (or better yet, include it into your project and set the file to "Copy if newer" so it gets copied automatically). – qJake Oct 18 '11 at 19:28
  • Would that work even between different operating systems versions? – Michael Hedgpeth Oct 18 '11 at 19:42
  • Moving the dll over to the virtual machine allows it to run(not instant death exception) but it doesn't find any updates. There are at least seven that need to be downloaded. I think, maybe the version difference might be causing this to not work properly. Not sure of a reasonable way to be able to prove that though. – Thomas Oct 18 '11 at 20:13
  • WUA API DLL should be named "Wuaueng.dll" (there should NOT be 1 in the name) and the version "5.3.3790.5512" seems to be too old. "A version that is earlier than 5.4.3790.1000 indicates that Software Update Services (SUS) 1.0 is installed." - http://msdn.microsoft.com/en-us/library/aa385815%28v=VS.85%29.aspx – ivan Mar 02 '12 at 08:31

0 Answers0