3

I've been searching for a long time now for a way to check if a specific application is muted, and if it is, to un-mute it. This is for an application originally built for Windows XP, but when I run it on Windows 7/10/11 - it keep muting itself every so often during runtime.

I found @Simon Mourier's Fantastic suggestion here but, when I try to test it in Visual Studio 2017 [C# - Console app(.NET Core)] I'm getting an error on the 2 instances of

Guid IID_IAudioSessionManager2 = typeof(IAudioSessionManager2).GUID;

The error I'm getting is

Error CS1061 'Type' does not contain a definition for 'GUID' and no accessible extension method 'GUID' accepting a first argument of type 'Type' could be found (are you missing a using directive or an assembly reference?)

So, my question is - what am I doing wrong here?

I've found over a dozen different instances of this code being suggested via Google searches, and never a whisper of an error like mine.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
LabWoozle
  • 41
  • 3

1 Answers1

1

Thanks all for the quick responses! @HansPassant's response held the answer for me, I targeted .NET Core 2.1 and it works fine now.

LabWoozle
  • 41
  • 3
  • is there a reason why you are using such an old version? in case you don’t know that version is EOL (End of Life) since August 2021 - https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core – Rand Random Jul 08 '23 at 00:43
  • 1
    Noted. The systems this will be used on are a closed ecosystem with no internet or usb access, so I suppose I could have used a newer version, but I didn't want to add anything else new to the image, so updating to .net 6 or 7 was out. – LabWoozle Jul 10 '23 at 16:13