mcu
mcu

Reputation: 3512

Visual Studio and .DLL Version Number

I am trying to figure out which SAPI version I have installed on my Win XP Pro laptop.

I am adding sapi.dll to my project: Project > Add Reference > COM: Microsoft Speech Object Library 5.0 C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.dll

If I open Windows Explorer and navigate to C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.dll, it shows the version number as 5.1.4111.0

The interop file that is created by the Visual Studio (Interop.SpeechLib.dll) shows version number as 5.0.0.0

If I go to Project > Add Reference > Browse and manually browse for the dll, it makes no difference. While the physical dll shows version 5.1.4111.0, everything in Visual Studio turns into version 5.0.0.0

Why the discrepancy?

Thanks.

Upvotes: 3

Views: 3431

Answers (1)

Hans Passant
Hans Passant

Reputation: 941327

Because the type library version doesn't have anything to do with the file version. The library version describes the declared interface of the API. When a breaking change is made that requires programs to be recompiled then the library version is incremented.

The file version is an implementation detail. There were probably multiple revisions of it on XP, say for different service packs or security patches. "5.1" here means the Windows version number. 4.0 = Windows NT, 5.0 = Windows 2000, 5.1 = XP, 6.0 = Vista, 6.1 = Windows 7. A change in the file version doesn't require your program to be recompiled. You only care about the library version.

Upvotes: 2

Related Questions