-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Regression in v10 Preview 4 during a roll-forward from v9 causing System.TypeLoadException #61842
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
Comments
Manually changing the runtimeconfig.json files to reference newer major versions of the .net runtime and Asp.NET is likely unsupported in this case. I was able to repro the You'll need to work with bunit and\or LinkDotNet.Blog to see what their v10 support. |
@steveharter Thanks for help look into this issue.
We are the .NET AppCompat team. We are testing third-party applications by using DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX switch and the test machine only has the latest version of .NET nightly build installed. The goal is to identify any issues customers might come across with latest runtime and identify if it is an intentional breaking change.
This issue is not repro in dotnet-sdk-10.0.100-preview.3.25201.16 but start failed from dotnet-sdk-10.0.100-preview.4.25211.22. Have there been any recent changes in .NET 10 Preview 4 that might have introduced this issue? |
I'll take another look at this. Thanks for the info. |
I don't see any I repro'd this with The TypeLoadException exception appears to be thrown when calling The method "InvokeNew()" doesn't appear to have ever existed on The managed call stack:
with some frames:
internal object? CreateInstanceImpl(
BindingFlags bindingAttr, Binder? binder, object?[]? args, CultureInfo? culture)
{
...
if (invokeMethod.GetParametersAsSpan().Length == 0)
{
if (args.Length != 0)
{
Debug.Assert((invokeMethod.CallingConvention & CallingConventions.VarArgs) ==
CallingConventions.VarArgs);
throw new NotSupportedException(SR.NotSupported_CallToVarArg);
}
// fast path??
> instance = CreateInstanceLocal(wrapExceptions: wrapExceptions);
00007FFE9848FE96 mov rcx,qword ptr [rbp+10h]
00007FFE9848FE9A mov r8d,r15d
00007FFE9848FE9D mov edx,1
00007FFE9848FEA2 call qword ptr [System.Tuple.Create[[System.__Canon, System.Private.CoreLib],[System.__Canon, System.Private.CoreLib]](System.__Canon, System.__Canon)+0685E28h (07FFE9902B908h)]
} public class UnitTest1 : BunitContext
{
public UnitTest1() : base()
00007FFE0919F800 push rbp
00007FFE0919F801 push rdi
00007FFE0919F802 push rsi
00007FFE0919F803 sub rsp,20h
00007FFE0919F807 mov rbp,rsp
00007FFE0919F80A mov qword ptr [rbp+40h],rcx
00007FFE0919F80E cmp dword ptr [7FFE0906E940h],0
00007FFE0919F815 je TestDemo.UnitTest1..ctor()+01Ch (07FFE0919F81Ch)
00007FFE0919F817 call 00007FFE683D7410
00007FFE0919F81C mov rcx,qword ptr [rbp+40h]
> 00007FFE0919F820 call qword ptr [CLRStub[MethodDescPrestub]@00007FFE0912FF48 (07FFE0912FF48h)] and the last managed stack frame where this getter is being called:
and this appears to be native stack:
with last frame: _impResolveToken(CORINFO_TOKENKIND_NewObj);
00007FFEA2CDE72A mov r9d,202h
00007FFEA2CDE730 lea r8,[rbp-20h]
00007FFEA2CDE734 mov rdx,rbx
00007FFEA2CDE737 mov rcx,r15
00007FFEA2CDE73A and esi,0FFFFFFEEh
00007FFEA2CDE73D call Compiler::impResolveToken (07FFEA2CDB1DCh)
eeGetCallInfo(&resolvedToken, nullptr /* constraint typeRef*/,
00007FFEA2CDE742 mov edx,1 |
@jeffhandley Could you please take a look at this issue and help triage it? In the meantime, could you please help confirm if this is a blocker for .NET 10 Preview 4? Thanks. |
Calling in help from @jkotas or @dotnet/dotnet-coreclr on this, as this looks more like a jit/runtime topic than a libraries topic. I'm not aware of anything in the libraries side of things that could cause this failure. |
Introduced by #61246. This change introduced InvokeNew method on IJSInProcessRuntime: Adding new method to an interface without a default implementation is a breaking change. Any existing type that implements the interface will fail to load since the new interface method will be missing implementation. It is exactly what's happening here: https://github.com/bUnit-dev/bUnit/blob/c98316921a63047407c6915ace115069fb72ba9d/src/bunit.web/JSInterop/Implementation/BunitJSRuntime.cs#L9 is the type in |
Per @javiercn "This is a dupe of https://github.com/dotnet/aspnetcore/issues/61621 @javiercn please document this unintentional breaking change as a Preview 4 Known issue that will be addressed in Preview 5, so that customers are aware of it. |
Verified this issue with dotnet-sdk-10.0.100-preview.5.25266.36, it has been fixed. |
Description
When run the unit test of the 3rd party application with the latest .NET 10 build, it failed with error:
System.TypeLoadException : Method 'InvokeNew' in type 'Bunit.JSInterop.BunitJSRuntime' from assembly 'bunit' does not have an implementation
.Reproduction Steps
App Repro Steps:
dotnet vstest LinkDotNet.Blog.UnitTests.dll
Expected Result:
All cases passed.
Actual Result:
Some cases failed with error:
Minimal Repro Steps (Demo attached:Demo.zip):
dotnet vstest TestDemo.dll
.Expected behavior
Test1 Passed.
Actual behavior
Test1 Failed with error:
Regression?
Yes
Verify Scenarios:
1). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.104: Pass
2). Windows 10 21H2 AMD64 + dotnet-sdk-10.0.100-preview.3.25201.16: Pass
3). Windows 10 21H2 AMD64 + dotnet-sdk-10.0.100-preview.4.25211.22: Fail
4). Windows 10 21H2 AMD64 + dotnet-sdk-10.0.100-preview.4.25215.17: Fail
Known Workarounds
No response
Configuration
Application Name: Blog1
OS: Windows 10 21H2
CPU: X64
.NET Build Number: dotnet-sdk-10.0.100-preview.4.25215.17
App & Source Location checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2449783
Github Link: https://github.com/linkdotnet/Blog
Other information
Findings:
In the demo, if xUnit Test Project does not reference ASP.NET Core Project, the error will not repro.
@dotnet-actwx-bot @dotnet/compat
The text was updated successfully, but these errors were encountered: