Reputation: 11358
I created a sample to reproduce my issue at work, and the problem is there. I have a Solution with a WinForms project, targeting .NET framework 4.7, and a .NET Core library, targint .NET Core 2 (tried the 4.6.1 / .Net Standard 2.0 combination as well, same)
Form1.cs looks like:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(Helper.Method1(100).ToString());
}
}
Library code:
public static class Helper
{
public static int Method1(int a)
{
a = a + 1;
return a; //breakpoint here
}
}
I can't have Visual Studio hit the breakpoint in Helper, from the .net core library (in neither one of the combinations - .net framework vs .net core NOR .net framework (4.6.1) vs .net standard (2.0))
What am I missing ?
I found a Scott Hanselman's post on this, but, if I got him right, what is required is that the library does not taget a specific framework rather one of the .NET standards (and that the consuming project targeting framework complies with that standard). I seem to be doing that.
Upvotes: 0
Views: 1840
Reputation: 143
To be able to hit breakpoints set within Visual Studio, it needs to have information files (for instance the .pdb files you see within the ./bin/Debug directory) that help Visual Studio to know where exceptions occur, gather information on variable values, and way more stuff.
The amount of information that is generated in addition to the actual application/library files can be set accordingly here: Go to Project > Properties > Build > Advanced (button at bottom) > Debugging information.
Note: this is not solution wide setting, it needs to be set for each project. For more information on what the selectable settings mean: Advanced Build Settings Dialog Box
Upvotes: 1