jonwagner / Insight.Database

Fast, lightweight .NET micro-ORM
Other
861 stars 145 forks source link

MissingMethodException #408

Closed isaacadams closed 4 years ago

isaacadams commented 5 years ago

Describe the bug

Our team is experiencing the following exception in our staging environment

MissingMethodException: Method not found: 'Void Insight.Database.DbConnectionWrapper..ctor(IDbConnectioSystem.Collections.Generic.IDbConnection)'.

The stack trace shows that the last method it entered was a runtime generated constructor of the interface we passed into the As(DbConnection) method.

Steps to reproduce

This only occurs in our staging environment, so it is unclear how to reproduce it.

To make matters worse, after some time, the issue will go away. But it consistently comes back.

Expected behavior

A implementation of one of our interfaces should be created based on the given connection to out database.

jonwagner commented 5 years ago

Given that there are two open missing method issues, I’m starting to think that .net core has some stability issues with IL generation.

What version of .net core are you using?

On Nov 4, 2019, at 12:42 PM, Isaac Adams notifications@github.com wrote:

 Describe the bug

Our team is experiencing the following exception in our staging environment

MissingMethodException: Method not found: 'Void Insight.Database.DbConnectionWrapper..ctor(IDbConnectioSystem.Collections.Generic.IDbConnection)'.

The stack trace shows that the last method it entered was a runtime generated constructor of the interface we passed into the As(DbConnection) method.

Steps to reproduce

This only occurs in our staging environment, so it is unclear how to reproduce it.

To matters worse, after some time, the issue will go away. But it consistently comes back.

Expected behavior

A implementation of one of our interfaces should be created based on the given connection to out database.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/jonwagner/Insight.Database/issues/408?email_source=notifications&email_token=AAMTO5CGATJVPES6PMAOTOTQSBUHNA5CNFSM4JIXS5Z2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HWV3QDA, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAMTO5GGFCEUZKAAZOOT2PLQSBUHNANCNFSM4JIXS5ZQ.

isaacadams commented 5 years ago

@jonwagner we are using netcoreapp2.1 and the SDK we build on is 2.1.401

resnikb commented 5 years ago

@isaacadams The error message looks wierd - are you sure the constructor argument reported is of type IDbConnectioSystem.Collections.Generic.IDbConnection and not System.Data.IDbConnection?

isaacadams commented 5 years ago

@resnikb Thanks for chiming in. I am certain that this is what the exception said.

On top of that, the IDbConnectioSystem... looks like a spelling error as if I am missing an "n" in the word "Connection". However I am typing the the exception details exactly as I received them and that is exactly, character for character, what it stated.

isaacadams commented 5 years ago

This might be more helpful 😅

staging error (1) copy

isaacadams commented 5 years ago

The following exception occurred in the Insight.Database source code today, seemingly also related to runtime code generation.

E82EBBAA-4F79-4056-8415-93CD22A2D4F7

nwpz commented 5 years ago

I am seeing this issue as well in 2.1 and 2.2 code bases. It's intermittent and usually recycling the app pool corrects it but I was hopping to find a solution here :)

MissingMethodException: Method not found: 'Void Insight.Database.DbConnectionWrapper..ctor(IDbConnectioSystem.Collections.Generic.IDbConnection)'.

jonwagner commented 4 years ago

@resnikb identified an area where the interface generator code was not thread-safe. this should be fixed in v6.2.11.

nwpz commented 4 years ago

Thanks, I’ve been using a build with that code for close to a week without issue.

On Thu, Nov 28, 2019 at 11:12 AM Jon Wagner notifications@github.com wrote:

@resnikb https://github.com/resnikb identified an area where the interface generator code was not thread-safe. this should be fixed in v6.2.11.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jonwagner/Insight.Database/issues/408?email_source=notifications&email_token=AA23ZV2RYN6SJT44RY5HS7LQWACXRA5CNFSM4JIXS5Z2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFNHNRY#issuecomment-559576775, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA23ZVYIXNROL2I6DPKKRVLQWACXRANCNFSM4JIXS5ZQ .