Answered WUApiLib failed with .net35

bram0007

New member
Joined
Feb 22, 2021
Messages
2
Programming Experience
Beginner
Hey,

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:


C#:
Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'Interop.WUApiLib, Version=2.0.0.0, 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=2.0.0.0, 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).
 
.Net 4 onwards runs on CLR 4, before that was CLR 2, so it is not possible to use a .Net 4+ library in a .Net 3.5 app.

w7/2008r2 systems supports .Net 4.8 it says here: .NET Framework system requirements
 
Back
Top Bottom