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

[6.0] Test failure in System.Formats.Asn1 ReadVeryLongOid_WithAppContext: could not load file or assembly in NET48 #104647

Open
carlossanlop opened this issue Jul 9, 2024 · 8 comments
Labels
arch-x86 area-System.Formats.Asn1 Known Build Error Use this to report build issues in the .NET Helix tab needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration os-windows
Milestone

Comments

@carlossanlop
Copy link
Member

carlossanlop commented Jul 9, 2024

Build Information

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=734748
Build error leg or test failing: System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext

Error Message

{
  "ErrorMessage" : "System.IO.FileLoadException: Could not load file or assembly 'System.Formats.Asn1",
  "BuildRetry" : false,
  "ExcludeConsoleLog" : false
}
C:\h\w\B561097C\w\B5950A12\e>xunit.console.exe System.Formats.Asn1.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing  
  Discovering: System.Formats.Asn1.Tests (app domain = on [no shadow copy], method display = ClassAndMethod, method display options = None)
  Discovered:  System.Formats.Asn1.Tests (found 530 test cases)
  Starting:    System.Formats.Asn1.Tests (parallel test collections = on, max threads = 2)

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'System.Formats.Asn1, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.<>c.<ReadVeryLongOid_WithAppContext>b__9_0()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.DotNet.RemoteExecutor.Program.Main(String[] args)
    System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext [FAIL]
      Microsoft.DotNet.RemoteExecutor.RemoteExecutionException : Remote process failed with an unhandled exception.
      Stack Trace:
        
        Child exception:
          System.IO.FileLoadException: Could not load file or assembly 'System.Formats.Asn1, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
        File name: 'System.Formats.Asn1, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
           at System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.<>c.<ReadVeryLongOid_WithAppContext>b__9_0()
        
        WRN: Assembly binding logging is turned OFF.
        To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
        Note: There is some performance penalty associated with assembly bind failure logging.
        To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
        
        
        Child process:
          System.Formats.Asn1.Tests, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier+<>c Void <ReadVeryLongOid_WithAppContext>b__9_0()
        
        

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'System.Formats.Asn1, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.<>c.<ReadVeryLongOidArc_WithAppContext>b__10_0()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.DotNet.RemoteExecutor.Program.Main(String[] args)
    System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOidArc_WithAppContext [FAIL]
      Microsoft.DotNet.RemoteExecutor.RemoteExecutionException : Remote process failed with an unhandled exception.
      Stack Trace:
        
        Child exception:
          System.IO.FileLoadException: Could not load file or assembly 'System.Formats.Asn1, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
        File name: 'System.Formats.Asn1, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
           at System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.<>c.<ReadVeryLongOidArc_WithAppContext>b__10_0()
        
        WRN: Assembly binding logging is turned OFF.
        To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
        Note: There is some performance penalty associated with assembly bind failure logging.
        To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
        
        
        Child process:
          System.Formats.Asn1.Tests, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier+<>c Void <ReadVeryLongOidArc_WithAppContext>b__10_0()
        
        
  Finished:    System.Formats.Asn1.Tests
=== TEST EXECUTION SUMMARY ===
   System.Formats.Asn1.Tests  Total: 3423, Errors: 0, Failed: 2, Skipped: 0, Time: 6.249s

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=734748
Error message validated: [System.IO.FileLoadException: Could not load file or assembly 'System.Formats.Asn1]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 7/9/2024 10:09:27 PM UTC

Report

Build Definition Test Pull Request
842681 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext
842627 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #108861
842636 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext
842597 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext
842388 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext
842360 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #108861
842319 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #108300
842316 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #107828
842312 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #107826
842286 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #108797
842094 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext
840205 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #108797
839764 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #107828
839568 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #107826
839056 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #107764
838672 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #108300
838662 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #107756
835606 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #108714
835598 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext
832550 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOidArc_WithAppContext #108675
826910 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext
826713 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #107826
826727 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #107756
826722 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #106220
826707 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #107828
826718 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #107764
826702 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #108496
826704 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #108300
826699 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext
825571 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #105063
825318 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #108496
825308 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext
825183 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #105063
822572 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext
822415 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #108396
819580 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #108300
819567 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #107826
819563 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #107828
819575 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #107756
819570 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #107764
819555 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext
813345 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext
803018 dotnet/runtime System.Formats.Asn1.Tests.Reader.ReadObjectIdentifier.ReadVeryLongOid_WithAppContext #107592

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 12 43
@carlossanlop carlossanlop added arch-x86 os-windows area-System.Formats.Asn1 Known Build Error Use this to report build issues in the .NET Helix tab labels Jul 9, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jul 9, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-formats-asn1, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

@carlossanlop
Copy link
Member Author

carlossanlop commented Jul 16, 2024

@adamsitnik
Copy link
Member

It seems that it's a new test that has been recently backported to 6.0 in #104624 and 8.0 in #104623 (cc @bartonjs who has most likely authored it)

The failure does not seem to be a product issue, more like a testing problem? The code executed by the remote executor fails to load the assembly, because there is a manifest mismatch.

System.IO.FileLoadException: Could not load file or assembly 'System.Formats.Asn1, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

@carlossanlop @ericstj what could have caused such an exception?

My only idea for now it to disable it for Full Framework (because it seems to be the only affected configuration?).

@adamsitnik adamsitnik added needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration and removed untriaged New issue has not been triaged by the area owner labels Jul 16, 2024
@adamsitnik adamsitnik added this to the 6.0.x milestone Jul 16, 2024
@ericstj
Copy link
Member

ericstj commented Jul 16, 2024

Remote executor needs to be run with the same app.config as the test assembly. Since it's not getting the test assembly's app.config it's missing bindingRedirects.

I see remoteExecutor passes the deps and runtimeconfig for .NETCore processes (solving a similar problem). I bet it's never been plumbed for .NETFramework and folks don't notice except in servicing.

There's no way to pass the config on the commandline for .NETFramework. There might be an environment variable to set, barring that you could copy the config file. cc @ViktorHofer

@ViktorHofer
Copy link
Member

ViktorHofer commented Jul 16, 2024

We have this code piece which should already cover the app.config scenario on .NET Framework: https://github.com/dotnet/arcade/blob/fc2f7ce8372a55725aab7b48c25bad7327a9769d/src/Microsoft.DotNet.RemoteExecutor/src/build/Microsoft.DotNet.RemoteExecutor.targets#L8-L33

Note that there is no plumbing required on .NET Framework as we directly execute the RemoteExecutor.exe executable and that by default already picks up the .config file with the same name.

@bartonjs
Copy link
Member

If it's being noise, I'm fine with turning the test off; and that's the only change I feel empowered to make.

If infra wants to take a stab at making it work, that's cool with me. If not, off it goes.

@ericstj
Copy link
Member

ericstj commented Sep 4, 2024

Adjusting the milestone since noone will look at 6.0.0. This is still failing regularly in servicing builds.

@jeffhandley
Copy link
Member

Moving this out of 9.0.0, but when we do disable the test we should backport that to the servicing branches for 6.0, 8.0, and 9.0.

@jeffhandley jeffhandley modified the milestones: 9.0.0, 10.0.0 Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-x86 area-System.Formats.Asn1 Known Build Error Use this to report build issues in the .NET Helix tab needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration os-windows
Projects
None yet
Development

No branches or pull requests

6 participants