Questions tagged [inner-exception]

An exception thrown and wrapped in another exception.

An exception thrown and wrapped in another exception. It can be property of current exception.

34 questions
1
vote
2 answers

How can I check if the InnerException property of the Exception object is null?

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Error.aspx.cs" Inherits="XEx21HandleErrors.Error" %>
SMica
  • 41
  • 1
  • 6
1
vote
2 answers

Returning USERS from asp.net Identity 2.0 with Iqueryable

//GET api/Account/AllUsers [Route("AllUsers")] public List GetUsers() { var users = UserManager.Users.ToList(); return users; //return query; } This is the returned error, nothing else is…
1
vote
1 answer

WP8 - RateMyApp "addon" exception

I found out this nice addon by nokia, https://github.com/nokia-developer/rate-my-app I followed their guide to implement it in my app, that can be downloaded here…
1
vote
4 answers

Inner Exceptions C#

Story: I've 3 functions from 3 different classes. Functions calling order is: Form1_Load(...) -> Student.GetAllStudents(...) -> StudentDAL.GetStudentInformation(...) -> ConnectionManager.GetConnection(...) What I want to do is to display StackTrace…
1
vote
3 answers

Any "real-life" nested exceptions that are easy to intentionally cause in C#?

I'm playing around with improving my error handling, and also learning nLog. I'd like to be able to cause some "real" errors to test what my error handling is doing. Are there any that are easy to intentionally cause that will have inner…
techturtle
  • 2,519
  • 5
  • 28
  • 54
1
vote
1 answer

Unable to find an entry point named 'WSManInitialize' in DLL 'WsmSvc.dll'

I'm using C# service to execute Powershell commands on a remote machine and show the results. I'm using C# library System.Management.Automation.Runspaces to executing the commands on remote system. On one of the server, TypeInitializationException…
Senthil G
  • 13
  • 5
0
votes
1 answer

Updating database using SubmitChanges

I'm trying to update a record in a database through C# code. I found a solution that I think should work using SaveChanges. However, I'm getting an error from my catch statement that says: "An error occurred while starting a transaction on the…
0
votes
1 answer

Should I return an InnerException.Message to the user?

I'm making a save to the database. But an error occurs during the save process. When I catch it with try-catch block like below, it doesn't give detailed information. try{ //save to database } catch (Exception ex){ …
serdar
  • 9
  • 1
0
votes
1 answer

ASP.net InnerException: add record to DB

Been through my textbook, but I'm still having problems with catching an inner exception as I try to add a record to the database. What is the proper syntax for catching an InnerException in my class? The inner expection is being thrown on the…
Susan
  • 1,822
  • 8
  • 47
  • 69
0
votes
1 answer

how many inner exception may exists in a single exception handling in C#?

how many inner exceptions may exist in a single exception handling in C#? how many levels of Inner exception may have in the exception handling in c#.
0
votes
1 answer

Inner Exception Error: The INSERT statement conflicted with the FOREIGN KEY constraint

I am trying to add the Id of the Ticket Table to another table (TrackTicket) and insert it to the field (TicketId) and I got this error Error: An exception of type 'System.Data.Entity.Infrastructure.DbUpdateException' occurred in EntityFramework.dll…
0
votes
0 answers

Crash when trying to run with release, instead of debug - No error

The following stack trace is from me trying to run "Release" instead of "Debug" I've set my warning level to the highest, and there are no warnings or messages. The application works fine in Debug, but crashes without errors in Release I am assuming…
0
votes
0 answers

SaveChanges throws an exception, can't seem to find the reason

When running my code, I get an 'DbUpdateException was unhandled by user code', which shows in my application as an 'unhandled exception', refering to the 'inner exception' for details. I've read some articles on here which suggested building a…
Ciphra
  • 269
  • 2
  • 17
0
votes
0 answers

PerformanceCounter VB app with timer throws System.InvalidOperationException

I wrote a simple VB app years ago that uses a timer to call 2 PerformanceCounters, one to detect disk reads and the other for disk writes. That information is used to change a tray icon accordingly so it acts like an HDD LED on a computer case. It…
0
votes
1 answer

inner exception when using UserId as FK

this may be a simple problem for some of you, but I am have a difficult time trying to resolve it. I have a Message.cs class: public class Message : Audit { public int MessageId { get; set; } public string…