Inventory_Kamera icon indicating copy to clipboard operation
Inventory_Kamera copied to clipboard

[BUG] Type initializer threw an exception

Open 93luiz opened this issue 3 years ago • 15 comments

I get this error right after starting scan. Genshin window comes to foreground and then the apps changes from "Scanning" to "Scan aborted".

The full error log are as follows:

The type initializer for 'InventoryKamera.Scraper' threw an exception.
   at InventoryKamera.Scraper.RestartEngines()
   at InventoryKamera.InventoryKamera.GatherData(Boolean[] formats, Boolean[] checkbox) in B:\Projects\VisualStudio\InventoryKamera\InventoryKamera\InventoryKamera\InventoryKamera.cs:line 59
   at InventoryKamera.Form1.<>c__DisplayClass21_0.<StartButton_Clicked>b__0() in B:\Projects\VisualStudio\InventoryKamera\InventoryKamera\InventoryKamera\Form1.cs:line 207

93luiz avatar Dec 21 '21 02:12 93luiz

You need to rebuild to project. I get this when I clone the repository.

Andrewthe13th avatar Dec 21 '21 03:12 Andrewthe13th

I downloaded the .exe file from the releases page, do you think that building from source code could fix this for me?

93luiz avatar Dec 21 '21 11:12 93luiz

No you don't need to download the source code. This issue is caused by the program missing files not an error in actual program itself. The zip file should have everything you need to run the program. Just make sure to keep the .exe in the same folder as the rest of the files and it should work.

Andrewthe13th avatar Dec 21 '21 14:12 Andrewthe13th

Well the same issue if happening to me and i have every file i need to run the program in the file but it just does not want to start scanning it abortes immediately. I recently reinstalled my windows the scanner worked for me on the old windows but not anymore so maybe i dont have something dowloaded. btw i dowloaded all the microsoft visual stuff and it didnt help.

Natsunoo avatar Dec 21 '21 15:12 Natsunoo

same goes for me, I redownloaded the apps and still not working.

Object reference not set to an instance of an object. at InventoryKamera.CharacterScraper.ScanCharacters() in B:\Projects\VisualStudio\InventoryKamera\InventoryKamera\InventoryKamera\CharacterScraper.cs:line 23 at InventoryKamera.InventoryKamera.GatherData(Boolean[] formats, Boolean[] checkbox) in B:\Projects\VisualStudio\InventoryKamera\InventoryKamera\InventoryKamera\InventoryKamera.cs:line 94 at InventoryKamera.Form1.<>c__DisplayClass21_0.<StartButton_Clicked>b__0() in B:\Projects\VisualStudio\InventoryKamera\InventoryKamera\InventoryKamera\Form1.cs:line 207

that's my error line while using it, and this is my screenshot about the contents of the .zip file. and from what I saw on the error line, it starts with B:/ drive, mine starts from C:/. image

scoobymonza avatar Dec 21 '21 19:12 scoobymonza

same goes for me, I redownloaded the apps and still not working.

Object reference not set to an instance of an object. at InventoryKamera.CharacterScraper.ScanCharacters() in B:\Projects\VisualStudio\InventoryKamera\InventoryKamera\InventoryKamera\CharacterScraper.cs:line 23 at InventoryKamera.InventoryKamera.GatherData(Boolean[] formats, Boolean[] checkbox) in B:\Projects\VisualStudio\InventoryKamera\InventoryKamera\InventoryKamera\InventoryKamera.cs:line 94 at InventoryKamera.Form1.<>c__DisplayClass21_0.<StartButton_Clicked>b__0() in B:\Projects\VisualStudio\InventoryKamera\InventoryKamera\InventoryKamera\Form1.cs:line 207

that's my error line while using it, and this is my screenshot about the contents of the .zip file. and from what I saw on the error line, it starts with B:/ drive, mine starts from C:/. image

Well i downloaded the Node.js the 16.13.1 LTS and install everything that it comes including Chocolatey and it works for me now. i think you have to have python and all visual studios installed on your pc for the program to work properly.

https://nodejs.org/en/

Natsunoo avatar Dec 21 '21 20:12 Natsunoo

same goes for me, I redownloaded the apps and still not working. Object reference not set to an instance of an object. at InventoryKamera.CharacterScraper.ScanCharacters() in B:\Projects\VisualStudio\InventoryKamera\InventoryKamera\InventoryKamera\CharacterScraper.cs:line 23 at InventoryKamera.InventoryKamera.GatherData(Boolean[] formats, Boolean[] checkbox) in B:\Projects\VisualStudio\InventoryKamera\InventoryKamera\InventoryKamera\InventoryKamera.cs:line 94 at InventoryKamera.Form1.<>c__DisplayClass21_0.<StartButton_Clicked>b__0() in B:\Projects\VisualStudio\InventoryKamera\InventoryKamera\InventoryKamera\Form1.cs:line 207 that's my error line while using it, and this is my screenshot about the contents of the .zip file. and from what I saw on the error line, it starts with B:/ drive, mine starts from C:/. image

Well i downloaded the Node.js the 16.13.1 LTS and install everything that it comes including Chocolatey and it works for me now. i think you have to have python and all visual studios installed on your pc for the program to work properly.

https://nodejs.org/en/

already did what you did, and still got the same error code (I think).

Object reference not set to an instance of an object. at InventoryKamera.CharacterScraper.ScanCharacters() in B:\Projects\VisualStudio\InventoryKamera\InventoryKamera\InventoryKamera\CharacterScraper.cs:line 23 at InventoryKamera.InventoryKamera.GatherData(Boolean[] formats, Boolean[] checkbox) in B:\Projects\VisualStudio\InventoryKamera\InventoryKamera\InventoryKamera\InventoryKamera.cs:line 94 at InventoryKamera.Form1.<>c__DisplayClass21_0.<StartButton_Clicked>b__0() in B:\Projects\VisualStudio\InventoryKamera\InventoryKamera\InventoryKamera\Form1.cs:line 207

scoobymonza avatar Dec 21 '21 20:12 scoobymonza

Thank you all for your concern on this issue. I have found the problem and am working on a fix. The issue seemed to only happen if it somehow couldn't scan a character and it hadn't scanned at least 5 characters yet.

Cupcak3 avatar Dec 21 '21 21:12 Cupcak3

Hi there. Sorry for coming back to this issue after a long time. Please let us know if these issues have been fixed in recent releases or pre-releases so that we may close this issue. Thanks!

Cupcak3 avatar Feb 06 '22 20:02 Cupcak3

Can confirm I'm still getting this issue while using V1.2

The type initializer for 'InventoryKamera.Scraper' threw an exception.
   at InventoryKamera.Scraper.RestartEngines()
   at InventoryKamera.InventoryKamera.GatherData() in B:\Projects\VisualStudio\InventoryKamera\InventoryKamera\InventoryKamera\InventoryKamera.cs:line 66
   at InventoryKamera.Form1.<StartButton_Clicked>b__12_0() in B:\Projects\VisualStudio\InventoryKamera\InventoryKamera\InventoryKamera\Form1.cs:line 180

KEV1NI0 avatar Feb 07 '22 15:02 KEV1NI0

Is the issue gone in v1.2.1-prerelease?

Cupcak3 avatar Feb 07 '22 19:02 Cupcak3

Unfortunately, no. Same error, no lines. I do have the latest MS Visual C++ packages installed if that helps.

The type initializer for 'InventoryKamera.Scraper' threw an exception.
   at InventoryKamera.Scraper.RestartEngines()
   at InventoryKamera.InventoryKamera.GatherData()
   at InventoryKamera.Form1.<StartButton_Clicked>b__12_0()

KEV1NI0 avatar Feb 07 '22 20:02 KEV1NI0

Nvm, I think I figured it out. I needed to install the x86 version of the MS Visual C++ package as well to get it working. I saw that adeptiscanner needed both so I gave it a try. That fixed it for me. Please indicate in the readme to install both the x64 and x86 version (even if you're on a x64 system). I finished a full scan successfully. Only problem now is that it failed to parse the mora count and some materials. One suggestion I'd like to see is a lvl filter for weapons/artifacts. Either ways, great job dev!

KEV1NI0 avatar Feb 07 '22 22:02 KEV1NI0

Thanks for the info it really helps. I never concerned myself with the install requirements since it worked out of the box for me. I think there is a way for us to package it more complete for releases. That would be all new to me but I can look into it. In the meantime I'll add that to the readme.

As for the mora and material scanning that's a work in progress.

I can also look into level filters. At first glance it might have to work after everything is scanned because the process to determine when to stop scanning is currently based on rarities since that's the way items are sorted by default and it's predictable. It wouldn't be easy use rarity and level to stop scans, but it's an easy enough thing to filter after everything is scanned.

Cupcak3 avatar Feb 07 '22 22:02 Cupcak3

The type initializer for 'InventoryKamera.Scraper' threw an exception. at InventoryKamera.Scraper.RestartEngines() at InventoryKamera.InventoryKamera.GatherData() at InventoryKamera.MainForm.<StartButton_Clicked>b__12_0()

i tried installing x86 (which i didnt have) and x64 (already had, reinstalled it) and it still doesnt work. the weird part is, I actually completed a successful scan with these exact same settings a few days ago, and now I can't get it to work.

kurt22i avatar Feb 28 '22 00:02 kurt22i

I'm going to close this issue as it's grown stale. Feel free to reopen.

Cupcak3 avatar Sep 05 '22 22:09 Cupcak3