the-hideout / TarkovMonitor

Monitor Tarkov log files to help track progress, queues, and groups
GNU General Public License v3.0
91 stars 16 forks source link

Unable to Resolve LocalAppData Folder #55

Closed Ostabo closed 7 months ago

Ostabo commented 7 months ago

grafik

German equivalent of unhandled exception, after clicking on the new stats navigation

I assume the path is not set

Details:

System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
   at System.IO.Path.Combine(String path1, String path2)
   at System.Data.SQLite.SQLiteConnection..ctor(String connectionString, Boolean parseViaFramework)
   at System.Data.SQLite.SQLiteConnection..ctor(String connectionString)
   at TarkovMonitor.Stats..cctor() in TarkovMonitor\Stats.cs:line 18
Razzmatazzz commented 7 months ago

It can't find your LocalApplicationData folder. Is there anything unusual about your setup that would prevent an app from finding standard Windows configuration folders?

bitpushr commented 7 months ago

I get this as well, nothing unusual about my setup. Can reproduce by fresh installing it on a bone stock Windows 11 VM.

Razzmatazzz commented 7 months ago

If you Run "%LOCALAPPDATA%", does it open a folder, and if so, is there a TarkovMonitor folder within that folder?

Ostabo commented 7 months ago

Appdata/Local grafik -> TarkovMonitor grafik -> TarkovMonitor_Path_gu5... grafik

The TarkovMonitor folder is present and contains 2 subfolders - 1 containing another two subfolders for the versions I had installed, and one only containing the current 1.2.3 version i switched back to

bitpushr commented 7 months ago

Appdata/Local grafik -> TarkovMonitor grafik -> TarkovMonitor_Path_gu5... grafik

The TarkovMonitor folder is present and contains 2 subfolders - 1 containing another two subfolders for the versions I had installed, and one only containing the current 1.2.3 version i switched back to

Same here

Razzmatazzz commented 7 months ago

For some users, Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) is resolving to null. It should give the path for the user's %LocalAppData% folder. That path is used to create/access the local sqlite database that the app uses for storing raid and flea sales data for displaying statistics. Because it can't resolve that path, the database can't be created, and anything that would access the database causes the app to crash. These crash triggers are:

Razzmatazzz commented 7 months ago

Can someone experiencing this issue please try this build: https://github.com/the-hideout/TarkovMonitor/actions/runs/7865137539/artifacts/1236961902

Vaelek commented 7 months ago

I cloned the repo (not the build linked above) to try and step through it to see what might be happening. Malwarebytes wants to quarantine the DLL, but after allowing that, it seems to work fine when I build it myself..

Vaelek commented 7 months ago

Can someone experiencing this issue please try this build: https://github.com/the-hideout/TarkovMonitor/actions/runs/7865137539/artifacts/1236961902

This build crashes for me

Razzmatazzz commented 7 months ago

Does it happen to work if you run as administrator?

Vaelek commented 7 months ago

Does it happen to work if you run as administrator?

Negative

Razzmatazzz commented 7 months ago

I know where the error is occurring, I just can't figure out why some PCs fail to resolve these appdata folders properly.

Vaelek commented 7 months ago

As I mentioned above, if I build the solution myself with no changes, I can execute the build without errors. You have an additional packaging step that I do not know, but perhaps something in that is causing the issue? At least I assume you do, my build has a bunch more files.

Razzmatazzz commented 7 months ago

Oh yeah I think I might know what's going on.

Razzmatazzz commented 7 months ago

This should be resolved in the latest release.