Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to load System.Runtime reference assembly for execution causes test failure #53391

Open
runfoapp bot opened this issue May 13, 2021 · 5 comments
Open
Assignees
Labels
Area-IDE Flaky Test Test failures in roslyn-CI
Milestone

Comments

@runfoapp
Copy link

runfoapp bot commented May 13, 2021

The error message when failing is the following:

System.BadImageFormatException : Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058) ---- System.BadImageFormatException : Cannot load a reference assembly for execution.

Based on that I'd say it appears we are attempting to load a reference assembly here vs. the implementation assembly.

Runfo Tracking Issue: ReferenceDirective_FileWithDependencies flaky failure loading System.Runtime

Build Definition Kind Run Name

Build Result Summary

Day Hit Count Week Hit Count Month Hit Count
0 0 0
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Issues and PRs which have not yet been triaged by a lead labels May 13, 2021
@jaredpar jaredpar added Area-IDE Flaky Test Test failures in roslyn-CI and removed Area-Infrastructure labels May 13, 2021
@jaredpar
Copy link
Member

@tmat FYI

@jinujoseph jinujoseph removed the untriaged Issues and PRs which have not yet been triaged by a lead label May 19, 2021
@jinujoseph jinujoseph added this to the 16.11 milestone May 19, 2021
@sharwell sharwell changed the title ReferenceDirective_FileWithDependencies flaky failure loading System.Runtime Attempt to load System.Runtime reference assembly for execution causes test failuree May 19, 2021
@sharwell sharwell changed the title Attempt to load System.Runtime reference assembly for execution causes test failuree Attempt to load System.Runtime reference assembly for execution causes test failure May 19, 2021
@sharwell sharwell assigned tmat and unassigned sharwell May 19, 2021
@sharwell
Copy link
Member

@tmat @jaredpar I'm not sure where this exception is occurring, but it may be beneficial to change it to AssertOrFailFast so we can look at dumps to figure out what happened.

@jaredpar
Copy link
Member

Agree this is a really good candidate for AssertOrFailFast

@jinujoseph jinujoseph modified the milestones: 16.11, 17.0 Jul 16, 2021
@tmat
Copy link
Member

tmat commented Aug 4, 2021

Is there anything actionable at this point? I don't see any indicator of where this issue occurs.

@tmat
Copy link
Member

tmat commented Aug 4, 2021

Never mind, found a build that still exists:

System.TypeLoadException : No se puede cargar el tipo 'System.Threading.Tasks.Task`1' del ensamblado'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.


Stack trace
   en System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
   en System.Reflection.RuntimeMethodInfo.get_ReturnType()
   en System.Reflection.RuntimeMethodInfo.get_InvocationFlags()
   en System.Delegate.CreateDelegateInternal(RuntimeType rtType, RuntimeMethodInfo rtMethod, Object firstArgument, DelegateBindingFlags flags, StackCrawlMark& stackMark)
   en System.Reflection.RuntimeMethodInfo.CreateDelegateInternal(Type delegateType, Object firstArgument, DelegateBindingFlags bindingFlags, StackCrawlMark& stackMark)
   en System.Reflection.RuntimeMethodInfo.CreateDelegate(Type delegateType)
   en Roslyn.Utilities.ReflectionUtilities.CreateDelegate[T](MethodInfo methodInfo) en /_/src/Compilers/Core/Portable/InternalUtilities/ReflectionUtilities.cs:línea 115
   en Microsoft.CodeAnalysis.Scripting.ScriptBuilder.Build[T](Compilation compilation, DiagnosticBag diagnostics, Boolean emitDebugInformation, CancellationToken cancellationToken) en /_/src/Scripting/Core/ScriptBuilder.cs:línea 163
   en Microsoft.CodeAnalysis.Scripting.ScriptBuilder.CreateExecutor[T](ScriptCompiler compiler, Compilation compilation, Boolean emitDebugInformation, CancellationToken cancellationToken) en /_/src/Scripting/Core/ScriptBuilder.cs:línea 88
   en Microsoft.CodeAnalysis.Scripting.Script`1.GetExecutor(CancellationToken cancellationToken) en /_/src/Scripting/Core/Script.cs:línea 365
   en Microsoft.CodeAnalysis.Scripting.Script`1.RunAsync(Object globals, Func`2 catchException, CancellationToken cancellationToken) en /_/src/Scripting/Core/Script.cs:línea 465
   en Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests.InteractiveSessionTests.ReferenceDirective_FileWithDependencies() en /_/src/Scripting/CSharpTest/InteractiveSessionTests.cs:línea 1203

tmat added a commit that referenced this issue Aug 18, 2021
@tmat tmat mentioned this issue Aug 18, 2021
tmat added a commit that referenced this issue Aug 20, 2021
@jinujoseph jinujoseph modified the milestones: 17.0, 17.1 Sep 27, 2021
@tmat tmat modified the milestones: 17.1, 17.2 Jan 6, 2022
@jinujoseph jinujoseph removed this from the 17.2 milestone May 5, 2022
@jinujoseph jinujoseph added this to the 17.3 milestone May 5, 2022
@arunchndr arunchndr modified the milestones: 17.3, 17.6 P2 Jan 17, 2023
@arunchndr arunchndr modified the milestones: 17.6 P2, Backlog Oct 29, 2024
@CyrusNajmabadi CyrusNajmabadi modified the milestones: Backlog, 18.0 Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Flaky Test Test failures in roslyn-CI
Projects
None yet
Development

No branches or pull requests

6 participants