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

My server does not have NAT related functions here #153

Open
JediKings1937 opened this issue Feb 13, 2024 · 2 comments
Open

My server does not have NAT related functions here #153

JediKings1937 opened this issue Feb 13, 2024 · 2 comments

Comments

@JediKings1937
Copy link

My server does not have NAT related functions here
image

@JediKings1937
Copy link
Author

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Runtime.InteropServices.COMException (0x8007030E): 系统电源状态正从 转换为 。 (0x8007030E)
at NETCONLib.INetSharingConfiguration.EnableSharing(tagSHARINGCONNECTIONTYPE Type)
at WgServerforWindows.Models.InternetSharingPrerequisite.Resolve(String networkToShare) in D:\a\WgServerforWindows\WgServerforWindows\WgServerforWindows\Models\InternetSharingPrerequisite.cs:line 146
at WgServerforWindows.Models.InternetSharingPrerequisite.Resolve() in D:\a\WgServerforWindows\WgServerforWindows\WgServerforWindows\Models\InternetSharingPrerequisite.cs:line 52
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at GalaSoft.MvvmLight.Helpers.WeakAction.Execute()
at GalaSoft.MvvmLight.Command.RelayCommand.Execute(Object parameter)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

System.Runtime.InteropServices.COMException (0x8007030E): 系统电源状态正从 转换为 。 (0x8007030E)
at NETCONLib.INetSharingConfiguration.EnableSharing(tagSHARINGCONNECTIONTYPE Type)
at WgServerforWindows.Models.InternetSharingPrerequisite.Resolve(String networkToShare) in D:\a\WgServerforWindows\WgServerforWindows\WgServerforWindows\Models\InternetSharingPrerequisite.cs:line 146
at WgServerforWindows.Models.InternetSharingPrerequisite.Resolve() in D:\a\WgServerforWindows\WgServerforWindows\WgServerforWindows\Models\InternetSharingPrerequisite.cs:line 52

@micahmo
Copy link
Owner

micahmo commented Feb 13, 2024

Hi @JediKings1937, thanks for the issue!

My server does not have NAT related functions here

As mentioned in the README...

NAT Routing requires at least Windows 10, and the option to enable it will not even appear in the application on older versions of Windows.

Based on the screenshot, I believe you're running Windows Server 2012, which will not have the NAT options.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

If you get this error, try the workaround documented in the README.

https://github.com/micahmo/WgServerforWindows?tab=readme-ov-file#inability-to-enable-internet-sharing

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