MethodBoundaryAspect.Fody | Fody weaver which allows to decorate methods | Aspect Oriented library
kandi X-RAY | MethodBoundaryAspect.Fody Summary
kandi X-RAY | MethodBoundaryAspect.Fody Summary
A Fody weaver which allows to decorate methods and hook into method start, method end and method exceptions. Additionally you have access to useful method parameters. You can easily write your own aspects for.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MethodBoundaryAspect.Fody
MethodBoundaryAspect.Fody Key Features
MethodBoundaryAspect.Fody Examples and Code Snippets
Community Discussions
Trending Discussions on MethodBoundaryAspect.Fody
QUESTION
I have been implementing a []
attribute for some of our larger .NET solutions that will allow configurable analytics to be easily added to any functions/methods that are considered important. I'm using Fody and the MethodBoundaryAspect to intercept the entry and exit of each function and record metrics. This works well for synchronous functions, and for methods that return Task
there is a workable solution with Task.ContinueWith
, but for F# Async-returning functions, the OnExit
from the MethodBoundaryAspect runs as soon as the Async is returned (rather than when the Async is actually executed).
In order to capture correct metrics for F# Async-returning functions, I was trying to come up with an equivalent solution to using Task.ContinueWith
, but the closest thing I could think of was to create a new Async that binds the first one, runs the metric-capturing functions, and then returns the original result. This is further complicated by the fact that the F# Async return value I'm intercepting is presented only as an obj
, and I have to do everything thereafter reflectively, as there is no non-generic version of Async
like there is with Task
that I can use without knowing the exact return type.
My best solution so far looks roughly like this:
...ANSWER
Answered 2019-Mar-22 at 05:26Something like this is probably what you need:
QUESTION
I'm trying to use a method interceptor so I can run a method before certain marked methods in my Xamarin app. I installed Fody from the NuGet Package Manager, then downloaded MethodBoundaryAspect.Fody.
When creating my method interceptor class, the namespaces appear and the autocomplete works:
As soon as I try to build the solution and run it on the emulator, it fails gives me these errors:
And then in my class, it says that "The type or namespace 'MethodBoundaryAspect' could not be found", even though it was fine before I tried building the app:
Where have I gone wrong here? I'm open to using other open source method interceptors.
...ANSWER
Answered 2018-Nov-01 at 14:26This seems to be a bug in the weaver. We had the same issue in our project (albeit not Xamarin, but WPF with CPS) and resolved it with the workaround from the linked issue:
Open your csproj file and change the package import from
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install MethodBoundaryAspect.Fody
Create FodyWeavers.xml in your project and add the Weaver MethodBoundaryAspect to it (further details)
Write your custom aspects by deriving from OnMethodBoundaryAspect and decorate your methods (see sample below)
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page