I am trying to make the game add itself into the Firewall rule. I already referenced NetFwTypeLib.dll into the project. It led me to this line of code here:
INetFwPolicy2 fwPolicy2 = Activator.CreateInstance(typeof(INetFwPolicy2)) as INetFwPolicy2;
This gave me an exception of:
MissingMethodException: Default constructor not found for type NetFwTypeLib.INetFwPolicy2
I already tried
Activator.CreateInstance(Type.GetTypeFromProgID("HNetCfg.FwPolicy2"));
which led me to another exception of:
NotImplementedException: Unmanaged activation is not supported
I don't know what to try anymore. Thank you in advance.