I know sometimes innerException is null
So the following might fail:
repEvent.InnerException = ex.InnerException.Message;
Is ther
Its an old question but for future readers:
In addition to the answers already posted I think the correct way to do this (when you can have more than one InnerException) is Exception.GetBaseException Method
If you want the exception instance you should do this:
repEvent.InnerException = ex.GetBaseException();
If you are only looking for the message this way:
repEvent.InnerException = ex.GetBaseException().Message;