Answered WUApiLib failed with .net35


New member
Feb 22, 2021
Programming Experience

I have created a few python programs and i`m trying to learn c# at my own.
I`ll try to create a software to manage windows updates from w7/2008r2 to 2019. Thats the reason i`m tryning to make this .net3.5 compatible for w7/2008r2 systems.

When i build my program with .net472 everythings fine and works great but when i`ll rebuild this with .net35 i`ll get the following message:

Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'Interop.WUApiLib, Version=, Culture=neutral, PublicKeyToken=null' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
File name: 'Interop.WUApiLib, Version=, Culture=neutral, PublicKeyToken=null'

It`s possible because this wuapi.dll imported from w10 machine and not compatible with net35. At this point i`m tryning to import an old wuapi.dll from win2k8r2. After a import i`ll recieve a notification from visual studio 2019 thats everythings succeeded.
But after a rebuild and starting the program i`ll receive the same message. I`ll think its still using the w10 wuapi.dll?

How can i check the version of the DLL within the program and how can i import a older dll with the same name (description).
Top Bottom