Questions tagged [fody]

Extensible tool for weaving .net assemblies

Extensible tool for weaving .NET assemblies

Uses Mono.Cecil and an add-in based approach to modifying the IL of .net assemblies at compile time.

  • No install required to build
  • No attributes required
  • No references required
  • Supports .NET 3.5, .NET 4, .NET 4.5, Silverlight 3, Silverlight 4, Silverlight 5, Windows Phone 7 and .NET Metro on Windows 8, MonoTouch, MonoDroid, Mono
  • Supports client profile mode

Links:

181 questions
2
votes
1 answer

MethodDecorator.Fody and getting parameter values

I was wondering if with MethodDecorator it's possible to have the passed parameter during the OnException... that would be great since if I can catch an exception I can also have the passed parameter values Consider this piece of code static…
advapi
  • 3,661
  • 4
  • 38
  • 73
2
votes
1 answer

Get SequencePoint for CustomAttribute in Fody/Mono.Cecil

I am writing a Fody Addin and I am able to inject my code and to provide error messages to the user. I am able to determine the sequence points of instructions, but I cannot find a way to find the sequence points of CustomAttributes. I need to get…
Guido Roth
  • 219
  • 3
  • 10
2
votes
1 answer

Fody plugin Validar fails. Could not load type 'Validar.ValidationTemplateAttribute' from assembly mscorlib

I'm trying to use Validar to inject validation in my classes. My solution consists of multiple (5 for now, can become more in the future) projects in which I want to inject the validation. So I defined my ValidationTemplate class in one of them and…
Ric .Net
  • 5,540
  • 1
  • 20
  • 39
2
votes
0 answers

How can I listen for changes to sub-property using PropertyChanged.Fody?

I use the awesome weaver PropertyChanged.Fody for avoiding INotifyPropertyChanged boilerplate. I define dependent properties like this: public string FirstName { get; set; } public string LastName { get; set; } public string FullName { get { return…
Geir Sagberg
  • 9,632
  • 8
  • 45
  • 60
2
votes
1 answer

Error during building application with PropertyChanged.Fody

I have very simple project in WPF (PropertyChanged)- one view, one view model and one model. In this project I use package PropertyChanged.Fody. When I want to build this project after 10 second I get two error message: Could not copy…
wopi
  • 329
  • 4
  • 16
2
votes
1 answer

Configuring a Fody solution weaver

I am using Fody in-solution weaving. I have a couple of projects configured to use Fody and would like them to be able to pass in configuration to my weaver in the same fashion any other weaver could (via an auto-wired Config property). However, I…
me--
  • 1,978
  • 1
  • 22
  • 42
2
votes
1 answer

Fody PropertyChanged interfering with FxCop

I am currently working on a project where we would like to use the Fody PropertyChanged IL weaver. It appears to work fantastically, but it is doing strange things to our FxCop analysis built into visual studio. We have CA1062 and CA2214 enabled:…
2
votes
1 answer

Mono.Cecil GetTypeReference to ICommand

The System.Windows.Input.ICommand interface has been Type Forwarded as of .NET 4.5 from being in PresentationCore.dll to System.dll. I have 2 issues: How can I import this interface so I can use it as a return type of a property I am injecting into…
Damian
  • 2,709
  • 2
  • 29
  • 40
1
vote
1 answer

How to dynamically generate C# class at compile time?

For example, I have written a SomeEntity class: class SomeEntity { public object Content { get; set; } } I want my project to automatically generate the code for another class based on the SomeEntity: class SomeProvider { public SomeEntity…
Snowind
  • 102
  • 1
  • 13
1
vote
0 answers

embed dll file into exe and release physical file

using Fody/Costura to embedding dll file to single file is ok and all works good . but if i physically put dll file in executable folder and run application , application hook dll file and when i want to edit or delete dll file it throw an exception…
Moslem7026
  • 3,290
  • 6
  • 40
  • 51
1
vote
1 answer

How to exclude some methods in Fody when using MethodBoundaryAspect

I am using Fody to log every method "OnExit". It looks like this: [CustomLog(AttributeTargetMemberAttributes = MulticastAttributes.Public)] public class Driver { public static void Close() public static void Quit() public static void…
1
vote
0 answers

Unity errors when two packages that use Mono Cecil are imported

I have adopted the maintenance of a weaver package for Unity called Malimbe: https://github.com/ExtendRealityLtd/Malimbe Which weaves code to replace tags to remove common boilerplate. Malimbe uses Fody 3.5.5 which in turn uses Mono.Cecil and then…
TheStoneFox
  • 3,007
  • 3
  • 31
  • 47
1
vote
1 answer

Unable to uninstall Fody Costura

We used Fody Costura to pack a complex WPF application. Now, we want to uninstall it because of the huge size of the resulting executable. We deleted the nuget-packages (Fody, Fody-Costura) from all assemblies and deleted all bin and obj folders.…
Stefan
  • 15
  • 3
1
vote
0 answers

Reduce Boilerplate of WebAPI Controller

I was helping a colleague to refactor some old code that has been written and it's still developed in those days... we've found a pattern that occurs in each ActionController we write. I was wondering if it's possible to have a weaver that avoids…
advapi
  • 3,661
  • 4
  • 38
  • 73
1
vote
0 answers

Fody - System.Security.SecurityException: Invalid assembly public key

I just tried adding a Fody NuGet package to my C# project and now anytime I try to build I get the following error. error MSB4018: The "ResolveAssemblyReference" task failed unexpectedly. error MSB4018: System.Security.SecurityException: Invalid…
AcceleratXR
  • 43
  • 1
  • 3