diff --git a/ProtonVpn.sln b/ProtonVpn.sln
index 4cafd9609..6c1315b48 100644
--- a/ProtonVpn.sln
+++ b/ProtonVpn.sln
@@ -40,8 +40,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProtonVPN.Vpn.Tests", "src\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProtonVPN.Tests.Common", "src\Tests\ProtonVPN.Tests.Common\ProtonVPN.Tests.Common.csproj", "{A0DA4200-6643-4F2C-8450-65B8CE8A5576}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProtonVPN.Native", "src\ProtonVPN.Native\ProtonVPN.Native.csproj", "{CB301B4C-D518-41F5-873B-9B1F145DB4AF}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProtonVPN.NetworkFilter", "src\ProtonVPN.NetworkFilter\ProtonVPN.NetworkFilter.csproj", "{1CF1B8BF-57EB-4E49-B644-0A8F2DFEEB58}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProtonVPN.MarkupValidator", "src\ProtonVPN.MarkupValidator\ProtonVPN.MarkupValidator.csproj", "{BA03F069-6A26-45D1-8B05-6E61E3D9D1E1}"
@@ -660,22 +658,6 @@ Global
{A0DA4200-6643-4F2C-8450-65B8CE8A5576}.Release|x64.Build.0 = Release|Any CPU
{A0DA4200-6643-4F2C-8450-65B8CE8A5576}.Release|x86.ActiveCfg = Release|Any CPU
{A0DA4200-6643-4F2C-8450-65B8CE8A5576}.Release|x86.Build.0 = Release|Any CPU
- {CB301B4C-D518-41F5-873B-9B1F145DB4AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CB301B4C-D518-41F5-873B-9B1F145DB4AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CB301B4C-D518-41F5-873B-9B1F145DB4AF}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {CB301B4C-D518-41F5-873B-9B1F145DB4AF}.Debug|ARM64.Build.0 = Debug|Any CPU
- {CB301B4C-D518-41F5-873B-9B1F145DB4AF}.Debug|x64.ActiveCfg = Debug|Any CPU
- {CB301B4C-D518-41F5-873B-9B1F145DB4AF}.Debug|x64.Build.0 = Debug|Any CPU
- {CB301B4C-D518-41F5-873B-9B1F145DB4AF}.Debug|x86.ActiveCfg = Debug|Any CPU
- {CB301B4C-D518-41F5-873B-9B1F145DB4AF}.Debug|x86.Build.0 = Debug|Any CPU
- {CB301B4C-D518-41F5-873B-9B1F145DB4AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {CB301B4C-D518-41F5-873B-9B1F145DB4AF}.Release|Any CPU.Build.0 = Release|Any CPU
- {CB301B4C-D518-41F5-873B-9B1F145DB4AF}.Release|ARM64.ActiveCfg = Release|Any CPU
- {CB301B4C-D518-41F5-873B-9B1F145DB4AF}.Release|ARM64.Build.0 = Release|Any CPU
- {CB301B4C-D518-41F5-873B-9B1F145DB4AF}.Release|x64.ActiveCfg = Release|Any CPU
- {CB301B4C-D518-41F5-873B-9B1F145DB4AF}.Release|x64.Build.0 = Release|Any CPU
- {CB301B4C-D518-41F5-873B-9B1F145DB4AF}.Release|x86.ActiveCfg = Release|Any CPU
- {CB301B4C-D518-41F5-873B-9B1F145DB4AF}.Release|x86.Build.0 = Release|Any CPU
{1CF1B8BF-57EB-4E49-B644-0A8F2DFEEB58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1CF1B8BF-57EB-4E49-B644-0A8F2DFEEB58}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1CF1B8BF-57EB-4E49-B644-0A8F2DFEEB58}.Debug|ARM64.ActiveCfg = Debug|Any CPU
diff --git a/src/ProtonVPN.Native/PInvoke/Kernel32.cs b/src/ProtonVPN.Native/PInvoke/Kernel32.cs
deleted file mode 100644
index 02eb3e7ab..000000000
--- a/src/ProtonVPN.Native/PInvoke/Kernel32.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2023 Proton AG
- *
- * This file is part of ProtonVPN.
- *
- * ProtonVPN is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * ProtonVPN is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ProtonVPN. If not, see .
- */
-
-using System;
-using System.Diagnostics.CodeAnalysis;
-using System.Runtime.InteropServices;
-
-namespace ProtonVPN.Native.PInvoke
-{
- public class Kernel32
- {
- [DllImport("kernel32", CharSet = CharSet.Auto, SetLastError = true)]
- public static extern bool SetDefaultDllDirectories(SetDefaultDllDirectoriesFlags directoryFlags);
-
- [Flags]
- [SuppressMessage("ReSharper", "UnusedMember.Local")]
- [SuppressMessage("ReSharper", "InconsistentNaming")]
- public enum SetDefaultDllDirectoriesFlags : uint
- {
- LOAD_LIBRARY_SEARCH_APPLICATION_DIR = 0x00000200,
- LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000,
- LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800,
- LOAD_LIBRARY_SEARCH_USER_DIRS = 0x00000400,
- }
- }
-}
diff --git a/src/ProtonVPN.Native/Properties/AssemblyInfo.cs b/src/ProtonVPN.Native/Properties/AssemblyInfo.cs
deleted file mode 100644
index 2ffdfd992..000000000
--- a/src/ProtonVPN.Native/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2023 Proton AG
- *
- * This file is part of ProtonVPN.
- *
- * ProtonVPN is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * ProtonVPN is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ProtonVPN. If not, see .
- */
-
-using System.Runtime.InteropServices;
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("cb301b4c-d518-41f5-873b-9b1f145db4af")]
diff --git a/src/ProtonVPN.Native/ProtonVPN.Native.csproj b/src/ProtonVPN.Native/ProtonVPN.Native.csproj
deleted file mode 100644
index c7880be02..000000000
--- a/src/ProtonVPN.Native/ProtonVPN.Native.csproj
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
- net8.0-windows
- true
- Library
- false
- ..\bin\
- false
-
-
-
- Properties\GlobalAssemblyInfo.cs
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/ProtonVPN.Service/Properties/AssemblyInfo.cs b/src/ProtonVPN.Service/Properties/AssemblyInfo.cs
index c13d72307..6a7884044 100644
--- a/src/ProtonVPN.Service/Properties/AssemblyInfo.cs
+++ b/src/ProtonVPN.Service/Properties/AssemblyInfo.cs
@@ -23,3 +23,4 @@
[assembly: Guid("b23ab123-f51e-49b4-b434-282d8eeb137c")]
[assembly: InternalsVisibleTo("ProtonVPN.Service.Test")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
+[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
\ No newline at end of file
diff --git a/src/ProtonVPN.Service/ProtonVPN.Service.csproj b/src/ProtonVPN.Service/ProtonVPN.Service.csproj
index 537f0160a..d3979c65b 100644
--- a/src/ProtonVPN.Service/ProtonVPN.Service.csproj
+++ b/src/ProtonVPN.Service/ProtonVPN.Service.csproj
@@ -63,7 +63,6 @@
-
diff --git a/src/ProtonVPN.Service/Start/Bootstrapper.cs b/src/ProtonVPN.Service/Start/Bootstrapper.cs
index ad69c8678..bd167b816 100644
--- a/src/ProtonVPN.Service/Start/Bootstrapper.cs
+++ b/src/ProtonVPN.Service/Start/Bootstrapper.cs
@@ -34,7 +34,6 @@
using ProtonVPN.Logging.Contracts;
using ProtonVPN.Logging.Contracts.Events.AppServiceLogs;
using ProtonVPN.Logging.Installers;
-using ProtonVPN.Native.PInvoke;
using ProtonVPN.OperatingSystems.Network.Installers;
using ProtonVPN.Service.Settings;
using ProtonVPN.Service.Vpn;
@@ -56,7 +55,6 @@ public Bootstrapper()
public void Initialize()
{
- SetDllDirectories();
Configure();
PrepareDirectories();
Start();
@@ -148,9 +146,4 @@ private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionE
Resolve().Stop();
processes.KillProcesses(config.ClientName);
}
-
- private static void SetDllDirectories()
- {
- Kernel32.SetDefaultDllDirectories(Kernel32.SetDefaultDllDirectoriesFlags.LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
- }
}
\ No newline at end of file