Skip to content

Instantly share code, notes, and snippets.

View danmoseley's full-sized avatar
:shipit:

Dan Moseley danmoseley

:shipit:
  • Microsoft
  • Jackson, WY
  • 02:57 (UTC -06:00)
View GitHub Profile
// This test should apply equally to Unix, but this reliably hits a particular one of the
// myriad ways that assembly load can fail
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsWindows))]
public void LoadFile_ValidPEBadIL_ThrowsBadImageFormatExceptionWithPath()
{
string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "kernelbase.dll");
if (!File.Exists(path))
return;
AssertExtensions.ThrowsContains<BadImageFormatException>(() => Assembly.LoadFile(path), path);
System.InvalidOperationException: <some regular exception>
at _1.Program.<>c.<Main>b__0_0() in C:\proj\30\ConsoleApp1\Program.cs:line 21
at _1.Program.Wrap(Action cb) in C:\proj\30\ConsoleApp1\Program.cs:line 69
System.AggregateException: <aggmsg> (<outer1msg> (Parameter 'myarg')) (<outer2msg>)
____________________________________________________________________________________________________
|System.ArgumentException: <outer1msg> (Parameter 'myarg')
| at _1.Program.F(String type, String msg) in C:\proj\30\ConsoleApp1\Program.cs:line 177
System.InvalidOperationException: <some regular exception>
at _1.Program.<>c.<Main>b__0_0() in C:\proj\30\ConsoleApp1\Program.cs:line 21
at _1.Program.Wrap(Action cb) in C:\proj\30\ConsoleApp1\Program.cs:line 69
System.AggregateException: <aggmsg> (<outer1msg> (Parameter 'myarg')) (<outer2msg>)
____________________________________________________________________________________________________
|System.ArgumentException: <outer1msg> (Parameter 'myarg')
| at _1.Program.F(String type, String msg) in C:\proj\30\ConsoleApp1\Program.cs:line 177
System.InvalidOperationException: <some regular exception>
at _1.Program.<>c.<Main>b__0_0() in C:\proj\30\ConsoleApp1\Program.cs:line 21
at _1.Program.Wrap(Action cb) in C:\proj\30\ConsoleApp1\Program.cs:line 69
System.AggregateException: <aggmsg> (<outer1msg> (Parameter 'myarg')) (<outer2msg>)
---> System.ArgumentException: <outer1msg> (Parameter 'myarg')
at _1.Program.F(String type, String msg) in C:\proj\30\ConsoleApp1\Program.cs:line 169
at _1.Program.E(String type, String msg) in C:\proj\30\ConsoleApp1\Program.cs:line 162
System.InvalidOperationException: <some regular exception>
at _1.Program.<>c.<Main>b__0_0() in C:\proj\30\ConsoleApp1\Program.cs:line 21
at _1.Program.Wrap(Action cb) in C:\proj\30\ConsoleApp1\Program.cs:line 69
System.AggregateException: <aggmsg> (<outer1msg> (Parameter 'myarg')) (<outer2msg>)
---> System.ArgumentException: <outer1msg> (Parameter 'myarg')
at _1.Program.F(String type, String msg) in C:\proj\30\ConsoleApp1\Program.cs:line 169
at _1.Program.E(String type, String msg) in C:\proj\30\ConsoleApp1\Program.cs:line 162
@danmoseley
danmoseley / testexceptions2.cs
Last active October 21, 2019 03:37
test exceptions 2
using System;
using System.Collections.Generic;
using System.Runtime.ExceptionServices;
using System.IO;
using System.Net.Http;
using System.Reflection;
using System.Security;
using System.Security.Authentication;
using System.Threading.Tasks;
using System.Diagnostics;

Description

Customer Impact

Regression?

Risk

System.AggregateException: <aggmsg> (<outer1msg>
Parameter name: myarg) (<outer2msg>) ---> System.ArgumentException: <outer1msg>
Parameter name: myarg
at _1.Program.F(String type, String msg)
at _1.Program.E(String type, String msg)
at _1.Program.D(String type, String msg)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception source)
at _1.Program.C(String type, String msg)
at _1.Program.B(String type, String msg)
System.AggregateException: <aggmsg> (<outer1msg> (parameter 'myarg')) (<outer2msg>)
---> System.ArgumentException: <outer1msg> (parameter 'myarg')
at _1.Program.F(String type, String msg)
at _1.Program.E(String type, String msg)
at _1.Program.D(String type, String msg)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception source)
at _1.Program.C(String type, String msg)
at _1.Program.B(String type, String msg)
--- End of stack trace from previous location where exception was thrown ---
@danmoseley
danmoseley / noedi
Created June 10, 2019 03:42
without EDI boundary
System.AggregateException: <aggmsg> (<outer1msg> (parameter 'myarg')) (<outer2msg>)
---> System.ArgumentException: <outer1msg> (parameter 'myarg')
at _1.Program.F(String type, String msg)
at _1.Program.E(String type, String msg)
at _1.Program.D(String type, String msg)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception source)
at _1.Program.C(String type, String msg)
at _1.Program.B(String type, String msg)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception source)
at _1.Program.A(String type, String msg)