This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |