Browse Source

Fix .NET launcher, and some debugging issues

Bepis 3 years ago
parent
commit
d2a0d3886e

+ 1 - 1
BepInEx.Core/BepInEx.Core.csproj

@@ -19,7 +19,7 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
     <OutputPath>bin\$(Configuration)\</OutputPath>
     <DocumentationFile />
-    <PlatformTarget>x86</PlatformTarget>
+    <PlatformTarget>AnyCPU</PlatformTarget>
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     <DebugType>portable</DebugType>
   </PropertyGroup>

+ 3 - 1
BepInEx.NetLauncher/BepInEx.NetLauncher.csproj

@@ -10,12 +10,14 @@
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugType>full</DebugType>
-    <OutputPath>..\bin\net\</OutputPath>
+    <OutputPath>bin\Debug</OutputPath>
+    <PlatformTarget>x86</PlatformTarget>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>portable</DebugType>
     <OutputPath>..\bin\NetLauncher\</OutputPath>
     <DocumentationFile />
+    <PlatformTarget>x86</PlatformTarget>
   </PropertyGroup>
   <ItemGroup>
     <ProjectReference Include="..\BepInEx.Core\BepInEx.Core.csproj" />

+ 1 - 1
BepInEx.NetLauncher/NetPreloader.cs

@@ -18,7 +18,7 @@ namespace BepInEx.NetLauncher
 
 		public static void Start(string[] args)
 		{
-			if (ConfigEntrypointExecutable.Value == null)
+			if (string.IsNullOrEmpty(ConfigEntrypointExecutable.Value))
 			{
 				Log.LogFatal($"Entry executable was not set. Please set this in your config before launching the application");
 				Program.ReadExit();

+ 12 - 16
BepInEx.NetLauncher/Program.cs

@@ -13,24 +13,13 @@ namespace BepInEx.NetLauncher
 	{
 		internal static void PreloaderMain(string[] args)
 		{
-			PlatformUtils.SetPlatform();
-
-			Logger.Listeners.Add(new ConsoleLogListener());
-
-			ConsoleManager.Initialize(true);
-
-			NetPreloader.Start(args);
-		}
-
-		internal static void OuterMain(string[] args, string filename)
-		{
 			try
 			{
-				Paths.SetExecutablePath(filename);
+				Logger.Listeners.Add(new ConsoleLogListener());
 
-				AppDomain.CurrentDomain.AssemblyResolve += LocalResolve;
+				ConsoleManager.Initialize(true);
 
-				PreloaderMain(args);
+				NetPreloader.Start(args);
 			}
 			catch (Exception ex)
 			{
@@ -40,6 +29,15 @@ namespace BepInEx.NetLauncher
 			}
 		}
 
+		internal static void OuterMain(string[] args, string filename)
+		{
+			Paths.SetExecutablePath(filename);
+
+			AppDomain.CurrentDomain.AssemblyResolve += LocalResolve;
+
+			PreloaderMain(args);
+		}
+
 		private static Assembly LocalResolve(object sender, ResolveEventArgs args)
 		{
 			var assemblyName = new AssemblyName(args.Name);
@@ -72,8 +70,6 @@ namespace BepInEx.NetLauncher
 		{
 			try
 			{
-				Console.WriteLine("test");
-
 				string filename;
 
 #if DEBUG