icsmanager icon indicating copy to clipboard operation
icsmanager copied to clipboard

Disable show ComObject

Open jacobsiu opened this issue 8 years ago • 2 comments

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

jacobsiu avatar Jan 25 '17 23:01 jacobsiu

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.

sylwek-mw avatar Apr 10 '17 09:04 sylwek-mw

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.

jacobsiu avatar Apr 15 '17 01:04 jacobsiu