falahati / WindowsFirewallHelper

A class library to manage the Windows Firewall as well as adding your program to the Windows Firewall Exception list.
MIT License
274 stars 72 forks source link

Class not registered exception when attempting to use library #65

Open Strahan201 opened 3 months ago

Strahan201 commented 3 months ago

Hi!

I found this library and was happy to see how easy it would make adding a rule for my app. I did:

if (FirewallManager.Instance.Rules.Any(x => x.Name.Matches("GameManager"))) return;

When I run it, I'm getting:

System.Runtime.InteropServices.COMException
  HResult=0x80040154
  Message=Retrieving the COM class factory for component with CLSID {9C27C8DA-189B-4DDE-89F7-8B39A316782C} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
  Source=mscorlib
  StackTrace:
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at WindowsFirewallHelper.COMTypeResolver.CreateInstance[T]() in C:\Users\s_fal\Documents\Personal\Open-Source Projects\WindowsFirewallHelper\WindowsFirewallHelper\COMTypeResolver.cs:line 71

Any idea what's going on? Thanks!