Just reference the UserControl project instead of the DLL in your WinForm app, and when you debug your main app, you will be able to debug straight into your control as well.
[edit]
OK - I created a Test solution.
Added a ClassLibrary project, deleted the default Class1, added a UserControl called DemoUserControl, dropped a PictureBox on that, set it to Dock/Fill. Added a property called Image to the Control:
namespace DemoClassLibrary
{
public partial class DemoUserControl : UserControl
{
public Image Image
{
get
{
return MyPictureBox.Image;
}
set
{
MyPictureBox.Image = value;
}
}
public DemoUserControl()
{
InitializeComponent();
}
}
}
Added a WinForms project to the solution called DemoForm, set it as the Startup project. Added a reference to DemoClassLibrary.
Built the solution.
Dropped a DemoUserControl onto the form in the designer.
Added a button, handled it's Click event:
private void MyButton_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
if (ofd.ShowDialog() == DialogResult.OK)
{
Image image = Bitmap.FromFile(ofd.FileName);
MyDemoUserControl.Image = image;
}
}
Added a second button, handled it's Click event:
private void MyGetButton_Click(object sender, EventArgs e)
{
Image image = MyDemoUserControl.Image;
MessageBox.Show($"{image.Height}x{image.Width}");
}
Ran it.
Click button one, select an image, it shows.
Click button two, it shows the size.
Repeat - it works.
It's not perfect - you can't open the same image twice because it's locked as I don't Dispose my Bitmaps - but it works. Every time.
So what have I done that is different to what you have done?
[/edit]