Skip to content
This repository was archived by the owner on May 19, 2021. It is now read-only.

Exception on start #22

Closed
alexey-anufriev opened this issue Jan 14, 2018 · 10 comments
Closed

Exception on start #22

alexey-anufriev opened this issue Jan 14, 2018 · 10 comments

Comments

@alexey-anufriev
Copy link

alexey-anufriev commented Jan 14, 2018

OS: Windows 10
.NET:

Microsoft (R) .NET CLR Version Tool Version 4.6.1055.0
Copyright (c) Microsoft Corporation. All rights reserved.

Versions installed on the machine:
v2.0.50727
v4.0.30319

TC: Open program

Error:

System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Byte[]'.
at UnityLauncher.Form1.UpdateRecentProjectsList()
at UnityLauncher.Form1.Start()
at UnityLauncher.Form1.Form1_Load(Object sender, EventArgs e)
@unitycoder
Copy link
Owner

hmm looks like it happens on this line then, not yet sure why:
https://github.com/unitycoder/UnityLauncher/blob/master/UnityLauncher/Form1.cs#L264

@alexey-anufriev
Copy link
Author

why are you doing that conversion magic? afaik key.GetValue should give you a string.

@unitycoder
Copy link
Owner

they did it here also, saying that it returns object, actually cant remember if tested without it.. (and it works on most computers apparently)
https://msdn.microsoft.com/en-us/library/fdf576x1(v=vs.110).aspx

looks like should check if the data is binary or not, i can add that later:
https://stackoverflow.com/a/14668394/5452781

@unitycoder
Copy link
Owner

@alexey-anufriev
Copy link
Author

This version works fine!
But on the first tab the project name contains all the path to it, starting from C:\Program Files...

@unitycoder
Copy link
Owner

ok, i was using forward slash to split, LastIndexOf("/"),
so ill switch to this or check both
https://msdn.microsoft.com/en-us/library/system.io.path.directoryseparatorchar(v=vs.110).aspx

@unitycoder
Copy link
Owner

@alexey-anufriev
Copy link
Author

Cool, I am very happy now. Can you release fixed version?

@unitycoder
Copy link
Owner

@alexey-anufriev
Copy link
Author

Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants