C
C#8mo ago
Not_a

✅ Process.Start("Something"); Crashes

everytime i launch that it just crash, if u ask why did i put Infernum(); on the first block i just want to test it things i tried : 1. Disabling Antivirus 2.Trying it on another project 3.Catching an exception nothing worked before this i try the Process.Start method it worked but now it doesn't work at all note : beginner just learning C# about 2 months ago
15 Replies
phaseshift
phaseshift8mo ago
"https://steamcommunity.com/sharedfiles/filedetails/?id=3049110969" Thats not a process If you really want to use the windows registry to lookup what app to use for a url, then use shellExecute=true in ProcessStartInfo
cap5lut
cap5lut8mo ago
to use default applications to open documents (and urls) u have to use the shell to execute it. the following would open google in ur default browser:
var info = new ProcessStartInfo
{
FileName = "https://www.google.com/",
UseShellExecute = true
};
Process.Start(info);
var info = new ProcessStartInfo
{
FileName = "https://www.google.com/",
UseShellExecute = true
};
Process.Start(info);
Not_a
Not_a8mo ago
still doesn't work :') it just crash unless i start it from the .exe if i start it from the vs it crashes with no explanation
cap5lut
cap5lut8mo ago
hmm, then i dunno either, this at least isnt a problem with the code itself if the executable works fine does this little snippet as stand alone project crash as well?
Not_a
Not_a8mo ago
yep try on another project still crashing is there any other method for opening url?
cap5lut
cap5lut8mo ago
i would try updating to newest version; if u are in preview try stable
Not_a
Not_a8mo ago
i'm rarely updating my visual studio everytime there is new update i update it after a month is passed
cap5lut
cap5lut8mo ago
well, its definitively a problem with vs itself
Not_a
Not_a8mo ago
i think so bc before i update vs it work without problem even only with Process.Start method
cap5lut
cap5lut8mo ago
well im on the latest version and didnt have any issues but i have also never really experienced issues with VS, so i can only guess here as well
Not_a
Not_a8mo ago
my friend too hes using my code and it worked perfectly idk why i have that problem
cap5lut
cap5lut8mo ago
anyway, u should update the thread title making clear that VS crashes if u use Process.Start()
Not_a
Not_a8mo ago
yep you were right my VS is broken i just update it to the latest version and now its fixed
cap5lut
cap5lut8mo ago
glad to hear it worked out i guess u can $close this thread now
MODiX
MODiX8mo ago
Use the /close command to mark a forum thread as answered