Fody - code weaving made fun

Tomek Pluskiewicz
Tomek PluskiewiczMakoLab - we web it for you
{{
FodyFody
code weaving made funcode weaving made fun
About meAbout me
 Tomasz PluskiewiczTomasz Pluskiewicz
 WrocławWrocław
 MakoLab S.A.MakoLab S.A.
 @tpluscode@tpluscode
 About code weavingAbout code weaving
 About FodyAbout Fody
 ExamplesExamples
 QuestionsQuestions
AgendaAgenda
„„Generate” additional code to:Generate” additional code to:
 Add boilerplate code automaticallyAdd boilerplate code automatically
 Implement Aspect-Oriented ProgrammingImplement Aspect-Oriented Programming
 ObfuscationObfuscation
 Build killer APIsBuild killer APIs
What is code weaving?What is code weaving?
 Source code weavingSource code weaving
 Compile-time weavingCompile-time weaving
 Runtime weavingRuntime weaving
How can I weave?How can I weave?
 Emitting MSILEmitting MSIL
 Refelction.EmitRefelction.Emit
 Mono.CecilMono.Cecil
 Dynamic proxiesDynamic proxies
 Castle, LinFu, Unity, Impromptu InterfaceCastle, LinFu, Unity, Impromptu Interface
 AOPAOP
 PostSharp, AfterthoughtPostSharp, Afterthought
 RoslynRoslyn
The toolsThe tools
 Simple but less flexibileSimple but less flexibile
 Requires runtime reference to PostSharpRequires runtime reference to PostSharp
 Requires Visual Studio extensionRequires Visual Studio extension
 Aspects in embedded resourcesAspects in embedded resources
 Full functionality is not freeFull functionality is not free
PostSharpPostSharp
IL weaving (with Cecil)IL weaving (with Cecil)
 ILIL isis difficultdifficult
 Need to update PDBsNeed to update PDBs
 MSBuild integrationMSBuild integration
Fodies are small passerine
birds belonging to the genus
Foudia in the weaver family
Ploceidae
- wikipedia/Fody
WeaverWeaver
CodeCode
 Many pre-built weaversMany pre-built weavers
 Uses Mono.CecilUses Mono.Cecil
 Integrates into build processIntegrates into build process
 Works on build serversWorks on build servers
 Leaves no referencesLeaves no references
 Well… depending on the pluginWell… depending on the plugin
 Versatile:Versatile:
 .NET 3.5-4.5.NET 3.5-4.5
 Silverlight 4 & 5Silverlight 4 & 5
 Mono, MonoTouch, MonoDroidMono, MonoTouch, MonoDroid
 Windows Phone 7 & 8 (also Metro)Windows Phone 7 & 8 (also Metro)
 Portable Class LibraryPortable Class Library
FodyFody
 Almost 70 packages on NuGetAlmost 70 packages on NuGet
 NullGuardNullGuard
 PropertyChangedPropertyChanged
 CosturaCostura
 AnotarAnotar
 ModuleInitModuleInit
 FreezableFreezable
 MethodDecoratorMethodDecorator
 InfoOfInfoOf
 ToStringToString
Community weaversCommunity weavers
DemoDemo
 Emitting IL is still required (duh!)Emitting IL is still required (duh!)
 However FodyHowever Fody
 Injects weavers to build pipelineInjects weavers to build pipeline
 Loads assembliesLoads assemblies
 Rewrites PDBsRewrites PDBs
 Reapplies strong nameReapplies strong name
 Writes to MSBuild build logWrites to MSBuild build log
Custom weavingCustom weaving
 Assembly with .Fody suffixAssembly with .Fody suffix
 ILMerge referencesILMerge references
 Pulic ModuleWeaver classPulic ModuleWeaver class
 Mutltiple deployment optionsMutltiple deployment options
 In-solutionIn-solution
 $(SolutionDir)/Tools
 NuGet packageNuGet package
 Learn fromLearn from
 existing weavers (example follows)existing weavers (example follows)
 Fody wikiFody wiki
Writing a weaverWriting a weaver
DemoDemo
 Don’t use Visual Studio pluginDon’t use Visual Studio plugin
 Weaver order sometimes does matterWeaver order sometimes does matter
 Debugging unavailable codeDebugging unavailable code

 LogInfo requires detailed MSBuild outputLogInfo requires detailed MSBuild output
 Tools -> Projects and Solutions -> Build andTools -> Projects and Solutions -> Build and
RunRun
 Remember to update Fody packageRemember to update Fody package
GotchasGotchas
 https://github.com/Fody/https://github.com/Fody/
 https://github.com/Fody/Fody/wiki/HowToWriteAnAddinhttps://github.com/Fody/Fody/wiki/HowToWriteAnAddin
 https://github.com/Fody/Fody/wiki/ModuleWeaverhttps://github.com/Fody/Fody/wiki/ModuleWeaver
 https://github.com/Fody/Fody/wiki/DeployingAddinsAsNugetshttps://github.com/Fody/Fody/wiki/DeployingAddinsAsNugets
 http://www.planetgeek.ch/2013/08/31/dont-wear-woven-sweatshirts-instead-weave-your-http://www.planetgeek.ch/2013/08/31/dont-wear-woven-sweatshirts-instead-weave-your-
assemblies/assemblies/
 http://haacked.com/archive/2013/01/04/mitigate-the-billion-dollar-mistake-with-aspects.aspx/http://haacked.com/archive/2013/01/04/mitigate-the-billion-dollar-mistake-with-aspects.aspx/
LinksLinks
Questions?Questions?
Fody - code weaving made fun
The end – wake up nowThe end – wake up now 
1 of 21

Recommended

Introduction to dotNetRDF by
Introduction to dotNetRDFIntroduction to dotNetRDF
Introduction to dotNetRDFTomek Pluskiewicz
4.2K views21 slides
Don’t like RDF Reification? Making Statements about Statements Using Singleto... by
Don’t like RDF Reification? Making Statements about Statements Using Singleto...Don’t like RDF Reification? Making Statements about Statements Using Singleto...
Don’t like RDF Reification? Making Statements about Statements Using Singleto...Vinh Nguyen
8.4K views20 slides
Bebidas de la Comunidad de los Chiles by
Bebidas de la Comunidad de los ChilesBebidas de la Comunidad de los Chiles
Bebidas de la Comunidad de los ChilesMEP
303 views3 slides
Trabajo impress rolando by
Trabajo impress rolandoTrabajo impress rolando
Trabajo impress rolandoRolandostr
549 views12 slides
2010 Coolest & Gaps Branding Survey - ESP & ENG by
2010 Coolest & Gaps Branding Survey - ESP & ENG2010 Coolest & Gaps Branding Survey - ESP & ENG
2010 Coolest & Gaps Branding Survey - ESP & ENGAllegro 234
527 views38 slides
Seguiremos siendo amigos by
Seguiremos siendo amigosSeguiremos siendo amigos
Seguiremos siendo amigosdaniela malca villagra
1.2K views51 slides

More Related Content

Viewers also liked

Catalogo general general electric geit 10012 en-rev6_final by
Catalogo general general electric geit 10012 en-rev6_finalCatalogo general general electric geit 10012 en-rev6_final
Catalogo general general electric geit 10012 en-rev6_finalPablo Bavarisco
943 views19 slides
Colaboración entre familias, escuela y entorno. Las gafitas de Andreita. by
Colaboración entre familias, escuela y entorno. Las gafitas de Andreita. Colaboración entre familias, escuela y entorno. Las gafitas de Andreita.
Colaboración entre familias, escuela y entorno. Las gafitas de Andreita. Juani Martinez Nuñez
774 views10 slides
Laminas cap6 by
Laminas cap6Laminas cap6
Laminas cap6meriam alaoui ismaili
831 views20 slides
el colibri by
el colibriel colibri
el colibrivillelmora
1.1K views10 slides
Www bizcommunity com_company_view_thedoanlawfirmp_c by
Www bizcommunity com_company_view_thedoanlawfirmp_cWww bizcommunity com_company_view_thedoanlawfirmp_c
Www bizcommunity com_company_view_thedoanlawfirmp_cAshamedCent199
254 views4 slides
ES145 01-Especial Perfumes-Top Expresiones de Compra by
ES145 01-Especial Perfumes-Top Expresiones de CompraES145 01-Especial Perfumes-Top Expresiones de Compra
ES145 01-Especial Perfumes-Top Expresiones de CompraBint
1.1K views43 slides

Viewers also liked(18)

Catalogo general general electric geit 10012 en-rev6_final by Pablo Bavarisco
Catalogo general general electric geit 10012 en-rev6_finalCatalogo general general electric geit 10012 en-rev6_final
Catalogo general general electric geit 10012 en-rev6_final
Pablo Bavarisco943 views
Colaboración entre familias, escuela y entorno. Las gafitas de Andreita. by Juani Martinez Nuñez
Colaboración entre familias, escuela y entorno. Las gafitas de Andreita. Colaboración entre familias, escuela y entorno. Las gafitas de Andreita.
Colaboración entre familias, escuela y entorno. Las gafitas de Andreita.
el colibri by villelmora
el colibriel colibri
el colibri
villelmora1.1K views
Www bizcommunity com_company_view_thedoanlawfirmp_c by AshamedCent199
Www bizcommunity com_company_view_thedoanlawfirmp_cWww bizcommunity com_company_view_thedoanlawfirmp_c
Www bizcommunity com_company_view_thedoanlawfirmp_c
AshamedCent199254 views
ES145 01-Especial Perfumes-Top Expresiones de Compra by Bint
ES145 01-Especial Perfumes-Top Expresiones de CompraES145 01-Especial Perfumes-Top Expresiones de Compra
ES145 01-Especial Perfumes-Top Expresiones de Compra
Bint1.1K views
Simulacro de examen lengua y literatura by Anicu12
Simulacro de examen lengua y literaturaSimulacro de examen lengua y literatura
Simulacro de examen lengua y literatura
Anicu121.6K views
Dominio internet by Geovypg
Dominio internetDominio internet
Dominio internet
Geovypg509 views
Articulo estrategias para lidiar con el acoso moral en las empresas by kristinamorales
Articulo estrategias para lidiar con el acoso moral en las empresasArticulo estrategias para lidiar con el acoso moral en las empresas
Articulo estrategias para lidiar con el acoso moral en las empresas
kristinamorales492 views
Guía psicología laboral ii modificada lic. leyden lopez by Mauricio Castro
Guía  psicología laboral ii modificada lic. leyden lopezGuía  psicología laboral ii modificada lic. leyden lopez
Guía psicología laboral ii modificada lic. leyden lopez
Mauricio Castro304 views
Robots in Human Environments by Andreas Heil
Robots in Human EnvironmentsRobots in Human Environments
Robots in Human Environments
Andreas Heil775 views
happytal recrute !! Stage concierge hopital by Romain Revellat
happytal recrute !! Stage concierge hopitalhappytal recrute !! Stage concierge hopital
happytal recrute !! Stage concierge hopital
Romain Revellat1.6K views
Why Semantic Knowledge Graphs matter by Andreas Blumauer
Why Semantic Knowledge Graphs matterWhy Semantic Knowledge Graphs matter
Why Semantic Knowledge Graphs matter
Andreas Blumauer2.5K views
2014 artwork contest results by happylily1116
2014 artwork contest results2014 artwork contest results
2014 artwork contest results
happylily1116850 views
TECNOLOGIA DE MICROONDAS by Medwaves
 TECNOLOGIA DE MICROONDAS  TECNOLOGIA DE MICROONDAS
TECNOLOGIA DE MICROONDAS
Medwaves1.1K views

Similar to Fody - code weaving made fun

From printed circuit boards to exploits by
From printed circuit boards to exploitsFrom printed circuit boards to exploits
From printed circuit boards to exploitsvirtualabs
69 views83 slides
ITB2019 CommandBox vs Node.js - Nolan Erck by
ITB2019  CommandBox vs Node.js - Nolan ErckITB2019  CommandBox vs Node.js - Nolan Erck
ITB2019 CommandBox vs Node.js - Nolan ErckOrtus Solutions, Corp
537 views80 slides
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ... by
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...Mark West
1.9K views67 slides
IronRuby for the Rubyist by
IronRuby for the RubyistIronRuby for the Rubyist
IronRuby for the RubyistWill Green
1K views34 slides
Windows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConf by
Windows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConfWindows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConf
Windows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConfPaul Stack
3.8K views26 slides
Why Have The Specifications Been Based On Java™ Technology? - P Kriens by
Why Have The Specifications Been Based On Java™ Technology? - P KriensWhy Have The Specifications Been Based On Java™ Technology? - P Kriens
Why Have The Specifications Been Based On Java™ Technology? - P Kriensmfrancis
573 views17 slides

Similar to Fody - code weaving made fun(20)

From printed circuit boards to exploits by virtualabs
From printed circuit boards to exploitsFrom printed circuit boards to exploits
From printed circuit boards to exploits
virtualabs69 views
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ... by Mark West
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
Mark West1.9K views
IronRuby for the Rubyist by Will Green
IronRuby for the RubyistIronRuby for the Rubyist
IronRuby for the Rubyist
Will Green1K views
Windows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConf by Paul Stack
Windows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConfWindows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConf
Windows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConf
Paul Stack3.8K views
Why Have The Specifications Been Based On Java™ Technology? - P Kriens by mfrancis
Why Have The Specifications Been Based On Java™ Technology? - P KriensWhy Have The Specifications Been Based On Java™ Technology? - P Kriens
Why Have The Specifications Been Based On Java™ Technology? - P Kriens
mfrancis573 views
Web of Technologies Again by dynamis
Web of Technologies AgainWeb of Technologies Again
Web of Technologies Again
dynamis 2.5K views
Modular JavaScript in an OSGi World - S Mak by mfrancis
Modular JavaScript in an OSGi World - S MakModular JavaScript in an OSGi World - S Mak
Modular JavaScript in an OSGi World - S Mak
mfrancis6.3K views
Cloudbusting 2012: All out on the cloud by Jan Jongboom
Cloudbusting 2012: All out on the cloudCloudbusting 2012: All out on the cloud
Cloudbusting 2012: All out on the cloud
Jan Jongboom468 views
Javaone2008 Bof 5102 Groovybuilders by Andres Almiray
Javaone2008 Bof 5102 GroovybuildersJavaone2008 Bof 5102 Groovybuilders
Javaone2008 Bof 5102 Groovybuilders
Andres Almiray2.2K views
XSS Without Browser by kosborn
XSS Without BrowserXSS Without Browser
XSS Without Browser
kosborn3.4K views
Devoxx France 2013 Cloud Best Practices by Eric Bottard
Devoxx France 2013 Cloud Best PracticesDevoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best Practices
Eric Bottard742 views
英文【Xu hao chen xiaobo】find your_own_ios_kernel_bug by Wang Hao Lee
英文【Xu hao chen xiaobo】find your_own_ios_kernel_bug英文【Xu hao chen xiaobo】find your_own_ios_kernel_bug
英文【Xu hao chen xiaobo】find your_own_ios_kernel_bug
Wang Hao Lee1.3K views
Reusando componentes Zope fuera de Zope by menttes
Reusando componentes Zope fuera de ZopeReusando componentes Zope fuera de Zope
Reusando componentes Zope fuera de Zope
menttes387 views

Recently uploaded

Digital Personal Data Protection (DPDP) Practical Approach For CISOs by
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOsPriyanka Aash
162 views59 slides
"Node.js Development in 2024: trends and tools", Nikita Galkin by
"Node.js Development in 2024: trends and tools", Nikita Galkin "Node.js Development in 2024: trends and tools", Nikita Galkin
"Node.js Development in 2024: trends and tools", Nikita Galkin Fwdays
33 views38 slides
Deep Tech and the Amplified Organisation: Core Concepts by
Deep Tech and the Amplified Organisation: Core ConceptsDeep Tech and the Amplified Organisation: Core Concepts
Deep Tech and the Amplified Organisation: Core ConceptsHolonomics
17 views21 slides
Cencora Executive Symposium by
Cencora Executive SymposiumCencora Executive Symposium
Cencora Executive Symposiummarketingcommunicati21
160 views14 slides
Mobile Core Solutions & Successful Cases.pdf by
Mobile Core Solutions & Successful Cases.pdfMobile Core Solutions & Successful Cases.pdf
Mobile Core Solutions & Successful Cases.pdfIPLOOK Networks
14 views7 slides
Transcript: Redefining the book supply chain: A glimpse into the future - Tec... by
Transcript: Redefining the book supply chain: A glimpse into the future - Tec...Transcript: Redefining the book supply chain: A glimpse into the future - Tec...
Transcript: Redefining the book supply chain: A glimpse into the future - Tec...BookNet Canada
41 views16 slides

Recently uploaded(20)

Digital Personal Data Protection (DPDP) Practical Approach For CISOs by Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash162 views
"Node.js Development in 2024: trends and tools", Nikita Galkin by Fwdays
"Node.js Development in 2024: trends and tools", Nikita Galkin "Node.js Development in 2024: trends and tools", Nikita Galkin
"Node.js Development in 2024: trends and tools", Nikita Galkin
Fwdays33 views
Deep Tech and the Amplified Organisation: Core Concepts by Holonomics
Deep Tech and the Amplified Organisation: Core ConceptsDeep Tech and the Amplified Organisation: Core Concepts
Deep Tech and the Amplified Organisation: Core Concepts
Holonomics17 views
Mobile Core Solutions & Successful Cases.pdf by IPLOOK Networks
Mobile Core Solutions & Successful Cases.pdfMobile Core Solutions & Successful Cases.pdf
Mobile Core Solutions & Successful Cases.pdf
IPLOOK Networks14 views
Transcript: Redefining the book supply chain: A glimpse into the future - Tec... by BookNet Canada
Transcript: Redefining the book supply chain: A glimpse into the future - Tec...Transcript: Redefining the book supply chain: A glimpse into the future - Tec...
Transcript: Redefining the book supply chain: A glimpse into the future - Tec...
BookNet Canada41 views
Business Analyst Series 2023 - Week 4 Session 8 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8
DianaGray10145 views
The Power of Generative AI in Accelerating No Code Adoption.pdf by Saeed Al Dhaheri
The Power of Generative AI in Accelerating No Code Adoption.pdfThe Power of Generative AI in Accelerating No Code Adoption.pdf
The Power of Generative AI in Accelerating No Code Adoption.pdf
Saeed Al Dhaheri39 views
"Package management in monorepos", Zoltan Kochan by Fwdays
"Package management in monorepos", Zoltan Kochan"Package management in monorepos", Zoltan Kochan
"Package management in monorepos", Zoltan Kochan
Fwdays34 views
GDSC GLAU Info Session.pptx by gauriverrma4
GDSC GLAU Info Session.pptxGDSC GLAU Info Session.pptx
GDSC GLAU Info Session.pptx
gauriverrma415 views
Discover Aura Workshop (12.5.23).pdf by Neo4j
Discover Aura Workshop (12.5.23).pdfDiscover Aura Workshop (12.5.23).pdf
Discover Aura Workshop (12.5.23).pdf
Neo4j15 views
Redefining the book supply chain: A glimpse into the future - Tech Forum 2023 by BookNet Canada
Redefining the book supply chain: A glimpse into the future - Tech Forum 2023Redefining the book supply chain: A glimpse into the future - Tech Forum 2023
Redefining the book supply chain: A glimpse into the future - Tech Forum 2023
BookNet Canada44 views
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」 by PC Cluster Consortium
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... by The Digital Insurer
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...
The Power of Heat Decarbonisation Plans in the Built Environment by IES VE
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built Environment
IES VE84 views
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu437 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays58 views

Fody - code weaving made fun

  • 1. {{ FodyFody code weaving made funcode weaving made fun
  • 2. About meAbout me  Tomasz PluskiewiczTomasz Pluskiewicz  WrocławWrocław  MakoLab S.A.MakoLab S.A.  @tpluscode@tpluscode
  • 3.  About code weavingAbout code weaving  About FodyAbout Fody  ExamplesExamples  QuestionsQuestions AgendaAgenda
  • 4. „„Generate” additional code to:Generate” additional code to:  Add boilerplate code automaticallyAdd boilerplate code automatically  Implement Aspect-Oriented ProgrammingImplement Aspect-Oriented Programming  ObfuscationObfuscation  Build killer APIsBuild killer APIs What is code weaving?What is code weaving?
  • 5.  Source code weavingSource code weaving  Compile-time weavingCompile-time weaving  Runtime weavingRuntime weaving How can I weave?How can I weave?
  • 6.  Emitting MSILEmitting MSIL  Refelction.EmitRefelction.Emit  Mono.CecilMono.Cecil  Dynamic proxiesDynamic proxies  Castle, LinFu, Unity, Impromptu InterfaceCastle, LinFu, Unity, Impromptu Interface  AOPAOP  PostSharp, AfterthoughtPostSharp, Afterthought  RoslynRoslyn The toolsThe tools
  • 7.  Simple but less flexibileSimple but less flexibile  Requires runtime reference to PostSharpRequires runtime reference to PostSharp  Requires Visual Studio extensionRequires Visual Studio extension  Aspects in embedded resourcesAspects in embedded resources  Full functionality is not freeFull functionality is not free PostSharpPostSharp
  • 8. IL weaving (with Cecil)IL weaving (with Cecil)  ILIL isis difficultdifficult  Need to update PDBsNeed to update PDBs  MSBuild integrationMSBuild integration
  • 9. Fodies are small passerine birds belonging to the genus Foudia in the weaver family Ploceidae - wikipedia/Fody
  • 11.  Many pre-built weaversMany pre-built weavers  Uses Mono.CecilUses Mono.Cecil  Integrates into build processIntegrates into build process  Works on build serversWorks on build servers  Leaves no referencesLeaves no references  Well… depending on the pluginWell… depending on the plugin  Versatile:Versatile:  .NET 3.5-4.5.NET 3.5-4.5  Silverlight 4 & 5Silverlight 4 & 5  Mono, MonoTouch, MonoDroidMono, MonoTouch, MonoDroid  Windows Phone 7 & 8 (also Metro)Windows Phone 7 & 8 (also Metro)  Portable Class LibraryPortable Class Library FodyFody
  • 12.  Almost 70 packages on NuGetAlmost 70 packages on NuGet  NullGuardNullGuard  PropertyChangedPropertyChanged  CosturaCostura  AnotarAnotar  ModuleInitModuleInit  FreezableFreezable  MethodDecoratorMethodDecorator  InfoOfInfoOf  ToStringToString Community weaversCommunity weavers
  • 14.  Emitting IL is still required (duh!)Emitting IL is still required (duh!)  However FodyHowever Fody  Injects weavers to build pipelineInjects weavers to build pipeline  Loads assembliesLoads assemblies  Rewrites PDBsRewrites PDBs  Reapplies strong nameReapplies strong name  Writes to MSBuild build logWrites to MSBuild build log Custom weavingCustom weaving
  • 15.  Assembly with .Fody suffixAssembly with .Fody suffix  ILMerge referencesILMerge references  Pulic ModuleWeaver classPulic ModuleWeaver class  Mutltiple deployment optionsMutltiple deployment options  In-solutionIn-solution  $(SolutionDir)/Tools  NuGet packageNuGet package  Learn fromLearn from  existing weavers (example follows)existing weavers (example follows)  Fody wikiFody wiki Writing a weaverWriting a weaver
  • 17.  Don’t use Visual Studio pluginDon’t use Visual Studio plugin  Weaver order sometimes does matterWeaver order sometimes does matter  Debugging unavailable codeDebugging unavailable code   LogInfo requires detailed MSBuild outputLogInfo requires detailed MSBuild output  Tools -> Projects and Solutions -> Build andTools -> Projects and Solutions -> Build and RunRun  Remember to update Fody packageRemember to update Fody package GotchasGotchas
  • 18.  https://github.com/Fody/https://github.com/Fody/  https://github.com/Fody/Fody/wiki/HowToWriteAnAddinhttps://github.com/Fody/Fody/wiki/HowToWriteAnAddin  https://github.com/Fody/Fody/wiki/ModuleWeaverhttps://github.com/Fody/Fody/wiki/ModuleWeaver  https://github.com/Fody/Fody/wiki/DeployingAddinsAsNugetshttps://github.com/Fody/Fody/wiki/DeployingAddinsAsNugets  http://www.planetgeek.ch/2013/08/31/dont-wear-woven-sweatshirts-instead-weave-your-http://www.planetgeek.ch/2013/08/31/dont-wear-woven-sweatshirts-instead-weave-your- assemblies/assemblies/  http://haacked.com/archive/2013/01/04/mitigate-the-billion-dollar-mistake-with-aspects.aspx/http://haacked.com/archive/2013/01/04/mitigate-the-billion-dollar-mistake-with-aspects.aspx/ LinksLinks
  • 21. The end – wake up nowThe end – wake up now 