Visual Studio stops debugging without errors

I am debugging a project, and Visual Studio stops debugging and closes the program on the next line without any exceptions or error messages (I turned on notifications of any abandoned exceptions in the options):

var query = Session.Linq<RSS>() .Where(x => x.LastRetrieved <= date || x.LastRetrieved == null) .Where(x => x.Moderated); 

Where Session.Linq refers to LINQ2NHibernate. In any case, the question is, what are the possible causes of this behavior? Tested both at VS 2010 and in 2008 - they behave the same, just falling away from debugging.

Refresh. If I change the application type to "Console Application", it works fine. Very strange.

+6
visual studio
source share
1 answer

I had a similar problem, and although this may not be the solution for your case above, I hope this helps someone else.

I had to refer to a class written by someone else that looked like this:

  public class ItemPrice { public bool sucessIndicator { get { return sucessIndicator; } set { sucessIndicator = value; } } public string productCode { get { return productCode; } set { productCode = value; } } public string description { get { return description; } set { description = value; } } public double price { get { return price; } set { price = value; } } } 

At first glance, this looks fine ... until you notice that each property refers to it independently, and not to a private user.

So:

 public string description { get { return description; } set { description = value; } } 

refers to it recursively and throws an exception that was not shown to me in VS, even though all exceptions were thrown. It just stopped debugging without warning.

The solution, of course, was to change it as follows:

 public string description { get; set; } 

Hope this helps someone.

+3
source share

All Articles