I'm struggling a bit trying to find a suitable approach and was hoping someone better versed in Fody/Cecil/MSBuild could point me in the right direction. I want to get the value of a project property from the
Execute() method in a Fody add-in. What's the best approach to take here?
I tried using
Microsoft.Build package to load the project and get the property but then you need to figure out what the current framework moniker is, what the configuration is, etc so that the right properties are parsed. Unfortunately I can't figure out how to get the current configuration (
DefineConstants isn't suitable for this) and it's also a rather complicated approach...after going down that path I was convinced that there has to be an easier way.
DefineConstants exposed so I thought that perhaps there's also a way to get other project properties somehow. I've dug around through
FodyHelpers in an attempt to locate something appropriate but so far I can't figure it out. Any idea how I can do this?
csprojproject properties instead of
FodyWeavers.xmlfor add-in configuration so that you could use
directory.build.propsfor weaver settings as well as facilitating more complex configurations, i.e. using
Condition=....to have different settings for different build configurations or target frameworks, etc
That makes sense, last I looked into this was probably a few months ago and I didn't check to see if something new popped up since then. Ah well, all good, less work for me going forward either way. Having it generalized to all add-ins like this is much nicer as well.
Thanks for the help!
ProcessedByFodyclasses and it's back to normal now, lol
AssemblyName_ProcessedByFodyclasses with conflicting names. Behavior stops when xml instead of csproj config is used.
ProcessedByFodyissue described above: Fody/Fody#895
<Weavers>config it goes absolutely bonkers on assemblies that use the new interface features (i.e. default methods, private/internal/static members, etc)