aws / aws-xray-sdk-dotnet

The official AWS X-Ray SDK for .NET.
Apache License 2.0
109 stars 64 forks source link

MissingMethodException: Method not found: 'System.String Amazon.XRay.Recorder.Core.Strategies.SegmentNamingStrategy.GetSegmentName(Microsoft.AspNetCore.Http.HttpRequest)'. #73

Open MarcusRosen opened 5 years ago

MarcusRosen commented 5 years ago

Hi,

I am are trying to integrate XRay into a ASP.NET Core 2.1 Application using full .NET Targeting (.NET Framework 4.6.1) running in Elastic Beanstalk. The reason for full ..NET targeting is integration with legacy services using assemblies only supporting older .net versions.

When registering XRAY using the .NET Core method Link the following exception occurs:

MissingMethodException: Method not found: 'System.String Amazon.XRay.Recorder.Core.Strategies.SegmentNamingStrategy.GetSegmentName(Microsoft.AspNetCore.Http.HttpRequest)'. Amazon.XRay.Recorder.Handlers.AspNetCore.Internal.AWSXRayMiddleware.ProcessHTTPRequest(HttpContext context) Amazon.XRay.Recorder.Handlers.AspNetCore.Internal.AWSXRayMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

It believe a similar issue was raised in issue #36 which has been closed but I don't see any comments on how work around this issue?

yogiraj07 commented 5 years ago

Hi @MarcusRosen , According to issue, ASPNET Core 3.0 is going to run only on NET Core platform. So I hadn't prioritize this work. I think more research needs to be done on some methods which are missing when running ASP.NET Core on net platform.

Can you try

  1. A workaround mentioned here, by extracting assemblies from net core nuget packages and referencing them in the project?
  2. Can you target to net472 and check whether you get errors?

I am happy to work with you on this support and a PR for NET Core 2.0 is welcome. At this point we don't have any plans to support this. I would keep this open for customer requests.