I think I had a configuration problem of the visual studio 2019 exception setting, which I am not able to solve.
I am trying to catch a simple exception, using try/catch block.
on one pc it works as intended (shows a message box), on other pc - using visual studio 2019, the program crashes, show the exception on the code it self. only after pressing the "continue" button, a message is shown.
both pc's are windows 10, running vs19.
I assumed that it is more a configuration problem, then a code problem (running the same code on both pc's).
please see code below:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Emgu;
using Emgu.CV;
using Emgu.CV.CvEnum;
using Emgu.CV.Structure;
namespace WindowsFormsApp8
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Capture _capture;
private void Form1_Load(object sender, EventArgs e)
{
_capture = new Capture(2);
}
private void btnCapture_Click(object sender, EventArgs e)
{
try
{
var img = _capture.QueryFrame().ToImage<Bgr, byte>();
var bmp = img.Bitmap;
picBoxCapture.Image = bmp;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}}