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

Support for asp.net core targeting full framework #36

Closed
blebaron opened this issue Jun 21, 2018 · 4 comments
Closed

Support for asp.net core targeting full framework #36

blebaron opened this issue Jun 21, 2018 · 4 comments

Comments

@blebaron
Copy link

blebaron commented Jun 21, 2018

I'm working on an asp.net project that is targeting the full .net framework. I get the following error when attempting to use the asp.net core XRay library:

System.MissingMethodException: Method not found: 'Boolean Amazon.XRay.Recorder.Core.AWSXRayRecorder.IsLambda()'.
   at Amazon.XRay.Recorder.Handlers.AspNetCore.Internal.AWSXRayMiddleware.ProcessHTTPRequest(HttpContext context)
   at Amazon.XRay.Recorder.Handlers.AspNetCore.Internal.AWSXRayMiddleware.<Invoke>d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.<Invoke>d__7.MoveNext()

I haven't dug in to try and find where the issue is but I have created a simple example that illustrates the issue here: https://github.com/blebaron/AWSXRayExample

I created the example by using the VS 2017 asp.net core api new project template and then modifying it to target the net461

@yogiraj07
Copy link
Contributor

Hi @blebaron ,

The reason for your exceptions is, you are using ASP.NETCore 2.0 X-Ray package for net461 framework.
IsLambda() is present only for netcore2.0 framework. As a result, X-Ray SDK doesn't find this method on net461 framework.
Reference: https://github.com/aws/aws-xray-sdk-dotnet/blob/master/sdk/src/Handlers/AspNetCore/Internal/AWSXRayMiddleware.cs#L225

I suggest to use ASP.NET X-Ray handler for net461 framework : https://github.com/aws/aws-xray-sdk-dotnet/tree/master#aspnet-framework-net--nuget

Is there any specific reason for a use case where you change the framework from netcore2.0 to net461?

Thanks,
Yogi

@blebaron
Copy link
Author

blebaron commented Jul 2, 2018

Sorry for the delayed response. I got this working by manually pulling out the .net core assemblies from the nuget packages and referencing them directly and then forgot that I had logged an issue.

I'm using the asp.net core MVC constructs (startup, kestrel, etc...) inside of a full framework project. That's why I can't use the net461 package. The example I linked to illustrates exactly how I have things set up.

@yogiraj07
Copy link
Contributor

Hi @blebaron ,
We appreciate your response.
Closing this issue.

Best,
Yogi

@dr3s
Copy link

dr3s commented Aug 20, 2018

I'm not sure why this was closed nor how @blebaron worked around the issue. Targeting kestrel and asp.net core is recommended for .net framework developers. How can xray instrument asp.net core on this platform?

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

3 participants