After some months of inactivity, I decided to work with Microsoft Visual Studio (C#) again.
After some clicks on "start debugging" I got windows error (I think svchost.exe has stopped working) and I don't know if this was relevant with what I'm about to say, but I'm not getting any errors when for example I'm calling an array out of bounds.
The program just doesn't execute the code assossiated with the error (I've noticed the array and file I/O problems) but continues to run normally which is driving me crazy because I have to click "start debugging" after I write each line of code just to be sure I'm correct.
So, Debug > Exceptions, it's chaos over there and I haven't touched it before. Any help would be appreciated.
EDIT: I've restarted 3 times my computer and did the Clean and Rebuild just now (the project) and nothing changed.
EDIT2: Sorry if it's confusing, here are some new info:
public partial class frmMain : Form
{
PictureBox[] pic = new PictureBox[120];
public frmMain()
{
InitializeComponent();
}
private void frmMain_Load(object sender, EventArgs e)
{
// Creating pictureboxes
for (int i = 1; i <= 199; i++) //199 instead of 120 or 119 and the rest of the for isn't executed plus no error or warning displayed.
{
pic[i] = new PictureBox();
EDIT3: Below is another example. If I try to read a non-existent file without the try-catch sequence, then the whole pic[] matrix is like being unloaded from the memory when the program runs.
pic[i].Image = Image.FromFile("H:\\My Pictures\\" + i + ".jpg");
EDIT4: Thank you for your time. I tried "Release" instead of "Debug" and the problem was fixed for a while.
When I decided to press "Continue" instead of "Break" on the "OutofRangeException", Windows popped this message: "Windows had to run the program on compatibility mode". Now when I press "start debugging" it's like before...