SlideShare ist ein Scribd-Unternehmen logo
1 von 21
{{
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?
The end – wake up nowThe end – wake up now 

Weitere ähnliche Inhalte

Andere mochten auch

Catalogo general general electric geit 10012 en-rev6_final
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
 
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.
Colaboración entre familias, escuela y entorno. Las gafitas de Andreita. Juani Martinez Nuñez
 
Www bizcommunity com_company_view_thedoanlawfirmp_c
Www bizcommunity com_company_view_thedoanlawfirmp_cWww bizcommunity com_company_view_thedoanlawfirmp_c
Www bizcommunity com_company_view_thedoanlawfirmp_cAshamedCent199
 
ES145 01-Especial Perfumes-Top Expresiones de Compra
ES145 01-Especial Perfumes-Top Expresiones de CompraES145 01-Especial Perfumes-Top Expresiones de Compra
ES145 01-Especial Perfumes-Top Expresiones de CompraBint
 
Simulacro de examen lengua y literatura
Simulacro de examen lengua y literaturaSimulacro de examen lengua y literatura
Simulacro de examen lengua y literaturaAnicu12
 
Dominio internet
Dominio internetDominio internet
Dominio internetGeovypg
 
Articulo estrategias para lidiar con el acoso moral en las empresas
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 empresaskristinamorales
 
Guía psicología laboral ii modificada lic. leyden lopez
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 lopezMauricio Castro
 
Robots in Human Environments
Robots in Human EnvironmentsRobots in Human Environments
Robots in Human EnvironmentsAndreas Heil
 
happytal recrute !! Stage concierge hopital
happytal recrute !! Stage concierge hopitalhappytal recrute !! Stage concierge hopital
happytal recrute !! Stage concierge hopitalRomain Revellat
 
Dudley CCG Think Kidneys Update
Dudley CCG Think Kidneys UpdateDudley CCG Think Kidneys Update
Dudley CCG Think Kidneys UpdateRenal Association
 
Why Semantic Knowledge Graphs matter
Why Semantic Knowledge Graphs matterWhy Semantic Knowledge Graphs matter
Why Semantic Knowledge Graphs matterAndreas Blumauer
 
2014 artwork contest results
2014 artwork contest results2014 artwork contest results
2014 artwork contest resultshappylily1116
 
TECNOLOGIA DE MICROONDAS
 TECNOLOGIA DE MICROONDAS  TECNOLOGIA DE MICROONDAS
TECNOLOGIA DE MICROONDAS Medwaves
 

Andere mochten auch (18)

Catalogo general general electric geit 10012 en-rev6_final
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
 
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.
Colaboración entre familias, escuela y entorno. Las gafitas de Andreita.
 
Laminas cap6
Laminas cap6Laminas cap6
Laminas cap6
 
el colibri
el colibriel colibri
el colibri
 
Www bizcommunity com_company_view_thedoanlawfirmp_c
Www bizcommunity com_company_view_thedoanlawfirmp_cWww bizcommunity com_company_view_thedoanlawfirmp_c
Www bizcommunity com_company_view_thedoanlawfirmp_c
 
ES145 01-Especial Perfumes-Top Expresiones de Compra
ES145 01-Especial Perfumes-Top Expresiones de CompraES145 01-Especial Perfumes-Top Expresiones de Compra
ES145 01-Especial Perfumes-Top Expresiones de Compra
 
Simulacro de examen lengua y literatura
Simulacro de examen lengua y literaturaSimulacro de examen lengua y literatura
Simulacro de examen lengua y literatura
 
Los terremotos ppts
Los terremotos pptsLos terremotos ppts
Los terremotos ppts
 
Dominio internet
Dominio internetDominio internet
Dominio internet
 
Articulo estrategias para lidiar con el acoso moral en las empresas
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
 
Guía psicología laboral ii modificada lic. leyden lopez
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
 
Robots in Human Environments
Robots in Human EnvironmentsRobots in Human Environments
Robots in Human Environments
 
happytal recrute !! Stage concierge hopital
happytal recrute !! Stage concierge hopitalhappytal recrute !! Stage concierge hopital
happytal recrute !! Stage concierge hopital
 
Dudley CCG Think Kidneys Update
Dudley CCG Think Kidneys UpdateDudley CCG Think Kidneys Update
Dudley CCG Think Kidneys Update
 
Why Semantic Knowledge Graphs matter
Why Semantic Knowledge Graphs matterWhy Semantic Knowledge Graphs matter
Why Semantic Knowledge Graphs matter
 
2014 artwork contest results
2014 artwork contest results2014 artwork contest results
2014 artwork contest results
 
TECNOLOGIA DE MICROONDAS
 TECNOLOGIA DE MICROONDAS  TECNOLOGIA DE MICROONDAS
TECNOLOGIA DE MICROONDAS
 
La optica
La opticaLa optica
La optica
 

Ähnlich wie Fody - code weaving made fun

From printed circuit boards to exploits
From printed circuit boards to exploitsFrom printed circuit boards to exploits
From printed circuit boards to exploitsvirtualabs
 
ITB2019 CommandBox vs Node.js - Nolan Erck
ITB2019  CommandBox vs Node.js - Nolan ErckITB2019  CommandBox vs Node.js - Nolan Erck
ITB2019 CommandBox vs Node.js - Nolan ErckOrtus Solutions, Corp
 
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 ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...Mark West
 
IronRuby for the Rubyist
IronRuby for the RubyistIronRuby for the Rubyist
IronRuby for the RubyistWill Green
 
Windows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConf
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
 
Why Have The Specifications Been Based On Java™ Technology? - P Kriens
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
 
Web of Technologies Again
Web of Technologies AgainWeb of Technologies Again
Web of Technologies Againdynamis
 
Modular JavaScript in an OSGi World - S Mak
Modular JavaScript in an OSGi World - S MakModular JavaScript in an OSGi World - S Mak
Modular JavaScript in an OSGi World - S Makmfrancis
 
Cloudbusting 2012: All out on the cloud
Cloudbusting 2012: All out on the cloudCloudbusting 2012: All out on the cloud
Cloudbusting 2012: All out on the cloudJan Jongboom
 
Javaone2008 Bof 5102 Groovybuilders
Javaone2008 Bof 5102 GroovybuildersJavaone2008 Bof 5102 Groovybuilders
Javaone2008 Bof 5102 GroovybuildersAndres Almiray
 
Bringing The Sexy Back To WebWorkers
Bringing The Sexy Back To WebWorkersBringing The Sexy Back To WebWorkers
Bringing The Sexy Back To WebWorkersCorey Clark, Ph.D.
 
XSS Without Browser
XSS Without BrowserXSS Without Browser
XSS Without Browserkosborn
 
Devoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best PracticesDevoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best PracticesEric Bottard
 
Find your own iOS kernel bug
Find your own iOS kernel bugFind your own iOS kernel bug
Find your own iOS kernel bugGustavo Martinez
 
英文【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
英文【Xu hao chen xiaobo】find your_own_ios_kernel_bugWang Hao Lee
 
Reusando componentes Zope fuera de Zope
Reusando componentes Zope fuera de ZopeReusando componentes Zope fuera de Zope
Reusando componentes Zope fuera de Zopementtes
 

Ähnlich wie Fody - code weaving made fun (20)

From printed circuit boards to exploits
From printed circuit boards to exploitsFrom printed circuit boards to exploits
From printed circuit boards to exploits
 
ITB2019 CommandBox vs Node.js - Nolan Erck
ITB2019  CommandBox vs Node.js - Nolan ErckITB2019  CommandBox vs Node.js - Nolan Erck
ITB2019 CommandBox vs Node.js - Nolan Erck
 
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 ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
 
IronRuby for the Rubyist
IronRuby for the RubyistIronRuby for the Rubyist
IronRuby for the Rubyist
 
Windows: Having its ass kicked by Puppet and Powershell since 2012 #PuppetConf
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
 
Why Have The Specifications Been Based On Java™ Technology? - P Kriens
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
 
Web of Technologies Again
Web of Technologies AgainWeb of Technologies Again
Web of Technologies Again
 
Mono for Android?
Mono for Android?Mono for Android?
Mono for Android?
 
Modular JavaScript in an OSGi World - S Mak
Modular JavaScript in an OSGi World - S MakModular JavaScript in an OSGi World - S Mak
Modular JavaScript in an OSGi World - S Mak
 
Taking The Cloud Native
Taking The Cloud NativeTaking The Cloud Native
Taking The Cloud Native
 
Cloudbusting 2012: All out on the cloud
Cloudbusting 2012: All out on the cloudCloudbusting 2012: All out on the cloud
Cloudbusting 2012: All out on the cloud
 
Javaone2008 Bof 5102 Groovybuilders
Javaone2008 Bof 5102 GroovybuildersJavaone2008 Bof 5102 Groovybuilders
Javaone2008 Bof 5102 Groovybuilders
 
Bringing The Sexy Back To WebWorkers
Bringing The Sexy Back To WebWorkersBringing The Sexy Back To WebWorkers
Bringing The Sexy Back To WebWorkers
 
XSS Without Browser
XSS Without BrowserXSS Without Browser
XSS Without Browser
 
JVM Bytecodes
JVM BytecodesJVM Bytecodes
JVM Bytecodes
 
Devoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best PracticesDevoxx France 2013 Cloud Best Practices
Devoxx France 2013 Cloud Best Practices
 
Find your own iOS kernel bug
Find your own iOS kernel bugFind your own iOS kernel bug
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英文【Xu hao chen xiaobo】find your_own_ios_kernel_bug
英文【Xu hao chen xiaobo】find your_own_ios_kernel_bug
 
Turbo charging v8 engine
Turbo charging v8 engineTurbo charging v8 engine
Turbo charging v8 engine
 
Reusando componentes Zope fuera de Zope
Reusando componentes Zope fuera de ZopeReusando componentes Zope fuera de Zope
Reusando componentes Zope fuera de Zope
 

Kürzlich hochgeladen

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 

Kürzlich hochgeladen (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

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
  • 20.
  • 21. The end – wake up nowThe end – wake up now 