Fix .NET launcher, and some debugging issues

This commit is contained in:
Bepis committed 2020-12-15 00:24:51 +11:00
1 parent 23ab09eac7
commit d2a0d3886e
4 files changed
+17 -19

No files matched your search

+1 -1
View File
@@ -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>
@@ -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
View File
@@ -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
View File
@@ -12,25 +12,14 @@ namespace BepInEx.NetLauncher
internal static class NetPreloaderRunner
{
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