Is it possible to find out the project folder/project file or output path of the assembly during compile time in Postsharp, i.e. during CompileTimeInitialize for example, when the assembly is being built?
Asked
Active
Viewed 161 times
1 Answers
3
You can find out the path to the current project file by evaluating the 'MSBuildProjectFullPath' property during compile time:
public override void CompileTimeInitialize(MethodBase method, AspectInfo aspectInfo)
{
string projectPath =
PostSharpEnvironment.CurrentProject
.EvaluateExpression("{$MSBuildProjectFullPath}");
}
The list of some other PostSharp properties can be found on this documentation page.

AlexD
- 5,011
- 2
- 23
- 34