Disable show ComObject
I run the icsmanager with Visual Studio and run into the following error. Need help ...I use Windows 10 and want to use c# to enable/disable ICs Thanks
C:\icsmanager-master\IcsManagerConsole\bin\Debug>IcsManager disable Internet Connection Sharing will be disabled: System.__ComObject -> System.__ComObject
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at NETCONLib.INetSharingConfiguration.DisableSharing() at IcsManagerLibrary.IcsManager.ShareConnection(INetConnection connectionToShare, INetConnection homeConnection) in C:\icsmanager-master\IcsManagerLibrary\IcsManager.cs:line 55 at IcsManagerConsole.Program.DisableICS() in C:\icsmanager-master\IcsManagerConsole\Program.cs:line 111 at IcsManagerConsole.Program.Main(String[] args) in C:\icsmanager-master\IcsManagerConsole\Program.cs:line 169
I've encountered the same problem. As far as I've investigated it, the problem seems to be in NETCONLib :( I've tried to achive the same result from PowerShell script but I'm getting the same error.
I guess the error is caused is .DisableICS() an adapter which is no longer Shared. I avoid this situation in my PowerShell by checking the adapter status first before running the .Disable(). I hope my message help.