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

Method not found: 'Amazon.CloudWatch.EMF.Logger.MetricsLogger Amazon.CloudWatch.EMF.Logger.IMetricsLogger.PutMetric(System.String, Double, Amazon.CloudWatch.EMF.Model.Unit)' #51

Open
Dave-EMIS opened this issue May 12, 2023 · 0 comments

Comments

@Dave-EMIS
Copy link

Dave-EMIS commented May 12, 2023

We are using :

  • Amazon.CloudWatch.EMF 2.1.0
  • Amazon.CloudWatch.EMF.Web 1.0.0
  • ASP.NET Core 6.0 / .NET 6.0

I then add UseEmf and UseEmfMiddleware we are getting the following error when making any call to our API:

An unhandled exception has occurred while executing the request.
System.MissingMethodException: Method not found: 'Amazon.CloudWatch.EMF.Logger.MetricsLogger Amazon.CloudWatch.EMF.Logger.IMetricsLogger.PutMetric(System.String, Double, Amazon.CloudWatch.EMF.Model.Unit)'.
at Amazon.CloudWatch.EMF.Web.ApplicationBuilderExtensions.<>c__DisplayClass1_0.<b__0>d.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Amazon.CloudWatch.EMF.Web.ApplicationBuilderExtensions.<>c__DisplayClass1_0.b__0(HttpContext context, Func`1 next)
at Microsoft.AspNetCore.Builder.UseExtensions.<>c__DisplayClass0_1.b__1(HttpContext context)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

This looks to be caused by #48

It should be resolved just by rebuilding and publishing the .Web against 2.1.0.

I've worked around the issue by just copying the source for the .Web package into my codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant