Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable show ComObject #12

Open
jacobsiu opened this issue Jan 25, 2017 · 2 comments
Open

Disable show ComObject #12

jacobsiu opened this issue Jan 25, 2017 · 2 comments

Comments

@jacobsiu
Copy link

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

@sylwek-mw
Copy link

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.

@jacobsiu
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants