Questions tagged [afterthought]

Afterthought allows developers to post-process .NET assemblies to add code that either cannot be added to the original source or is not convenient/efficient to do so.

Afterthought allows developers to post-process .NET assemblies to add code that either cannot be added to the original source or is not convenient/efficient to do so.

See https://github.com/vc3/Afterthought

6 questions
3
votes
1 answer

MSBuild Copying from IntermediateOutputPath After Build Completion

I am using Afterthought (similar to PostSharp) to apply post build changes to some code by modifying the output assembly. Currently, my project file has something like this within (abbreviated):
Ocelot20
  • 10,510
  • 11
  • 55
  • 96
2
votes
2 answers

Afterthought seems not working, simple code

I wrote simple piece of code to get involved into Afterthought, but it doesn't work and I've got no idea why. A huge part of it is taken from other SO question: How to implement simple Property Ammendment with Afterthought. using System; using…
lukiasz
  • 97
  • 1
  • 4
1
vote
1 answer

Running code before a BCL call with AOP in .NET

I'm trying to call a function after/before every function call to BCL in an ASP.NET application. For example when Server.MapPath is called I want to call my own function right after and before that particular call. Is there an AOP library that…
dr. evil
  • 26,944
  • 33
  • 131
  • 201
1
vote
0 answers

Is it possible to ammend a class attribute using Afterthought

I would like to know if it is possible to add attributes to a class at compile time using Afterthought. I know this is possible with PostSharp but for Afterthought, I can only see attribute ammendments on properties. I would like to do something…
Johan
  • 660
  • 1
  • 6
  • 13
0
votes
0 answers

Add code in compilation phase

I would like to just have a simple [LogData] public class MyFancyClass { public void DoStuff(int x){} } I would like to get the class parameter name along with their values, so check if x was 5 ot r 5. Can this be done with roslyn or do i need…
Aflred
  • 4,435
  • 6
  • 30
  • 43
0
votes
1 answer

Use Attributes with parameters in Afterthought

Say we have a property like this: [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] public class LogScopeAttribute : Attribute { public string Level { get;…
Dirk Boer
  • 8,522
  • 13
  • 63
  • 111