I'm attempting to use the API provided by https://github.com/EliteAPI/EliteAPI, and have created a simple application as per the example provided on . This was working exactly as expected yesterday, until for some reason my desktop crashed, and since then the application crashes with a NullReferenceException whenever it tries to create a new EliteDangerousAPI object:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using EliteAPI;
using EliteAPI.Events;
namespace Elite_PI_Server
{
class Program
{
private static EliteDangerousAPI EliteAPI;
static void Main(string[] args)
{
DirectoryInfo playerJournalFolder = new DirectoryInfo(
$@"C:\Users\{Environment.UserName}\Saved Games\Frontier
Developments\Elite Dangerous");
EliteAPI = new EliteDangerousAPI( playerJournalFolder );
EliteAPI.Start();
}
}
}
I stripped the code down to the above, I had a friend test this code on his machine, and it runs fine. It ran fine on my machine until the crash I spoke of.
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=EliteAPI
StackTrace:
at EliteAPI.Status.StatusWatcher.Update()
at EliteAPI.Status.StatusWatcher..ctor(EliteDangerousAPI api)
at EliteAPI.EliteDangerousAPI.Reset()
at EliteAPI.EliteDangerousAPI..ctor(DirectoryInfo JournalDirectory, Boolean SkipCatchUp)
at Elite_PI_Server.Program.Main(String[] args) in C:\Users\paul\source\repos\Elite-PI-Server-Console\Elite-PI-Server\Program.cs:line 22
For reference, i'm using Visual Studio Community Edition 2017 15.9.7. Any suggestions as to what I could try would be appreciated.
Considering the code was proven to work on another machine, I've attempted a few other heavy-handed methods which might seem a bit overkill:
I've tried uninstalling the nuget package for EliteAPI, clearing the nuget package cache and reinstalling.
I've tried completely reinstalling Visual Studio, and cleaning up the install with https://github.com/Microsoft/VisualStudioUninstaller.
Any suggestions would be highly appreciated. I feel like either something has become corrupt when my machine died, or i'm doing something stupid.