Skip to content

System.ArgumentException on H.OpenVpn #24

@BoGnY

Description

@BoGnY

Describe the bug

The line

var folder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty;
causes a System.ArgumentException 'Formato del percorso non valido.' (in english means 'Path format not valid')

Steps to reproduce the bug

Just call

HOpenVpn.Start(Config, Username, Password);

Expected behavior

OpenVpn connection succesfully

Screenshots

Exception:
image

NuGet package version

0.9.27

IDE

Visual Studio 2022

Additional context

Stacktrace:

System.ArgumentException
  HResult=0x80070057
  Messaggio=Formato del percorso non valido.
  Origine=mscorlib
  Analisi dello stack:
   in System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   in System.IO.Path.InternalGetDirectoryName(String path)
   in H.OpenVpn.HOpenVpn.Start(String config, String username, String password) in /_/src/libs/H.OpenVpn/OpenVPN.cs: riga 155
   in OpenVPN.Main.GnBtnConnect_Click(Object sender, EventArgs e) in C:\Luca\Progetti\OpenVPN\OpenVPN\Main.cs: riga 840
   in System.Windows.Forms.Control.OnClick(EventArgs e)
   in Guna.UI2.WinForms.Guna2GradientButton.OnClick(EventArgs e)
   in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   in System.Windows.Forms.Control.WndProc(Message& m)
   in System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   in System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   in System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   in OpenVPN.Program.Main() in C:\Luca\Progetti\OpenVPN\OpenVPN\Program.cs: riga 55

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions