183 questions
1
vote
0
answers
29
views
Automatically add a parameter `ITestOutputHelper` to all Test class constructors
We have a set of 15000+ xunit integration test classes in my application. We identified that the logs generated by the tests could not be correlated to the test itself unless we start using ...
0
votes
0
answers
246
views
Merging dlls into a single .exe with .NET framework 4.8 and doing it manually with no weaver
Merging dlls into a single .exe with wpf
based off this thread and commments
urprisingly easy! In short only three steps: 1. edit your .csproject and paste the provided lines 2. create a .cs file, ...
0
votes
0
answers
22
views
Caching using SpatialFocus.MethodCache but with Static Methods in C#
I am trying to use SpatialFocus.MethodCache but with a static method rather than in an instance of a class. I am getting an error:
1>MSBUILD : warning : Fody/SpatialFocus.MethodCache: Class Test ...
0
votes
0
answers
58
views
Conditional Aspect Logging
I am trying to replace logging boilerplate using AOP Fody. I manually write boilerplate, which print to logs: "Method started/finished".
Simplified code:
[Conditional("DEBUG")]
...
0
votes
1
answer
217
views
When Using Fody Property Changed and properties changed, Why it does not work?
I have a MVVM Prism Project with DBFirst and Entity Calsses. In View, I used My propertis of model (Class Entities) directly, and because I need to notify every other plcae in project that those ...
0
votes
1
answer
57
views
In Fody plugin, can I retrieve service from IServiceCollection/DI?
I am going to adopt https://github.com/vescon/MethodBoundaryAspect.Fody as my AOP engine. However, since it is a compile time approach, I have problem on how to retrieve service from ...
0
votes
1
answer
401
views
How to handle Fody related issues
I have just taken over a C# application, which seems to use some Fody library (whatever that means). First I had some problems that the Fody things were not working, not recognised, ..., and I've ...
1
vote
1
answer
349
views
MethodBoundaryAspect.Fody - LogAspect decoration not working when inside another Nuget
Well, I'm trying to make a Nuget just to simplify the process to Log in Azure Insights.
I'm using Serilog, MethodBoundaryAspect and default Microsoft logging libraries to make my package, the idea was ...
1
vote
0
answers
732
views
Fody not weaving PropertyChanged
I'm having trouble getting Fody & PropertyChanged working. I've got a .NET 4.7.2 project with both Fody(6.6.4) and PropertyChanged.Fody (4.1.0) packages added through NuGet, but only "...
0
votes
1
answer
46
views
Get named values from a Fody CustomAttribute Constructor
Can anyone tell me how to read the property assignments of a CustomAttribute's constructor
[Display(Name = "This name and value")]
They don't seem to appear in either theattribute....
0
votes
1
answer
236
views
Fody: Copy an attribute from one property to another
I iterate through all classes, then all properties, then their attributes. When I see an attribute MetaAttribute(typeof(SomethingElse)) I find a property named Target on that class and copy all of its ...
0
votes
1
answer
173
views
PropertyChanged Fody accesses ObservableCollection
Is it possible to instruct Fody to generate PropertyChanged Events for the Properties Color1
and Color2 if the corresponding Items in the ObservableCollection _colors are changing?
public class ...
1
vote
1
answer
2k
views
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 ...
1
vote
0
answers
127
views
Virtuosity.Fody and Unity project?
I'm trying to use Virtuosity.Fody in a Unity project and I've followed the steps to install it, but it's not actually doing any weaving. The unit tests that depend on virtual methods fail if I remove ...
1
vote
0
answers
182
views
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 ...
2
votes
1
answer
114
views
Use Fody.EmptyConstructor on a separate project?
I have a solution with two projects Business and Domain I'm using Fody.EmptyConstructor to create parameterless constructors for my domain models on runtime. It works well when I add the Fody....
0
votes
1
answer
266
views
How Blazor Server AOP logging?
I would like to implement and use an AOP logging in my Blazor Server .NET 5 (C# 9) application, for generic enter-exit-exception scenarios for the marked method(s).
I know how to do it with ...
1
vote
1
answer
617
views
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 ...
1
vote
0
answers
1k
views
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 ...
0
votes
0
answers
228
views
Modify IL during compilation: Workaround for declaring a constant custom struct
I'm writing a library for ternary computing, based on Trits instead of Bits. Trits can have three values. Sometimes represented as 0,1 and 2, sometimes as -1, 0 and 1. I've called them Down, Middle ...
0
votes
0
answers
116
views
Using a locally defined class instead of the one provided by a library/package C# IL Weaving
I have seen stuff like Fody and in fact have been using PropertyChanged which reduces the boilerplate code after implementing the INotifyPropertyChanged interface.
I believe it is done by 'weaving the ...
0
votes
1
answer
175
views
WFP View not updating when object properties change with INotifyPropertyChanged implemented via Fody
I've looked everywhere and can't seem to find a solution to this. The object/class that I have bound to a WPF form shows the object properties fine on the first creation of the object. Now however, ...
1
vote
1
answer
464
views
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 ...
1
vote
0
answers
61
views
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 ...
0
votes
1
answer
769
views
ReactiveUI Fody [Reactive] attribute not working in Xamarin Forms
I've tried following the documentation for ReactiveUI.Fody.
https://github.com/kswoll/ReactiveUI.Fody
Added the FodyWeavers.xml the generated file to the shared project.
<Weavers xmlns:xsi="...
3
votes
2
answers
938
views
How to reference a Fody MethodDecorator in another project?
I'm trying to use the Fody MethodDecorator to log method entry/exit in multiple projects. I've created a project in visual studio and implemented the IMethodDecorator interface as described in the ...
0
votes
0
answers
718
views
Error during building application with Fody and Costura via VS 2019 : Binary is being used by another process
I have a C# Console application that was developed in different machines. In this application, we chose to use Fody, because it's the only thing we found that would embed all external resource ...
1
vote
1
answer
127
views
How to disable separate Fody plugin in Release mode?
I'm using MethodDecorator.Fody (for injecting debug stuff) and some other plugins (PropertyChaged etc.).
Is there any way to disable MethodDecorator.Fody in Release build mode but keep the others ...
2
votes
0
answers
882
views
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.
...
9
votes
3
answers
10k
views
C# - why costura and fody doesn't work to me?
(Translator used.)
I was making an exe file using Costura and Fody. However, if the dll file is missing, it cannot run. And there is a warning in my Visual Studio.
Warn:
FodyPackageReference Fody: The ...
0
votes
2
answers
2k
views
Fody and Assembly.GetExecutingAssembly().Location returns empty string
I was calling Assembly.GetExecutingAssembly().Location in one of the dlls of a solution of mine. When I tried to use Fody (https://www.nuget.org/packages/Fody/) to package my binaries into a single ...
27
votes
6
answers
13k
views
MsBuild cannot resolve MsBuildMajorVersion
I have Visual Studio Solution with more than 100 projects. Five of them have Fody's nuget packages installed (version 6.0.3). When I try to build the Solution I get the following error:
Fody.6.3.0\...
0
votes
0
answers
296
views
Is it possible to weave into every method of a project using MethodDecorator.Fody?
I understand MethodDecorator.Fody provides a means to define an attribute decorator that can be used on any method throughout the assembly. Is it possible to have it automatically apply to all methods ...
-1
votes
1
answer
553
views
Fody PropertyChanged Weaver Causes Memory Issues
I installed PropertyChanged.Fody into a WPF application. Now 3rd party code that uses native memory are having memory allocation issues. Uninstalling PropertyChanged.Fody resolves all these issues. I ...
0
votes
0
answers
191
views
Application breaks on re-throw Exception Fody
I am trying to handle all the exceptions thrown from a async method,
but when i throw the exception after the execution of an async child method,then on re-throw exception from fody(OnException method)...
0
votes
1
answer
1k
views
How to hide content view from content page view model(Xamarin forms,freshmvvm)
I am adding like this content view which is having its own view model.I want to handle its visibility from view model of content page.
<ContentPage>
<local:ContentView1 IsVisible=&...
0
votes
2
answers
152
views
Source Not Available on Fody decorated methods
I have the following scenario:
Where ProjectA is a simple class library, and ProjectB is a Console Application.
ProjectA.Class1.cs contains the following code:
using System;
namespace ProjectA
{...
7
votes
0
answers
465
views
How to Inject dependencies when using MethodDecorator.Fody
I am trying to use MethodDevorator.Fody to enable Attribute based method interception.
https://github.com/Fody/MethodDecorator/blob/master/readme.md#your-code
I wanted to create a reusable component ...
0
votes
1
answer
655
views
Fody.WeavingTask task fails unexpectedly with System.TypeInitializationException
I am on Fody 2.3.15 with Nullguard 1.6.3. The build environment uses MS Build 15.0. The devops build task was working fine in the past but now the build log files show the following error to which I ...
0
votes
1
answer
463
views
Fody System.OutOfMemoryException
I have a Xamarin Forms project where I use PropertyChanged.Fody.
I have update at the version 3.2.8 and this error is trigger when I try to compile the PCL project.
I'm on Visual Studio 16.6.0 on ...
0
votes
0
answers
128
views
Can't extend MVVMLight's ViewModelBase with INotifyPropertyChanged
I had been using my own ViewModelBase and RelayCommand, and recently I installed MVVMLight, as well as PropertyChanged.Fody. It appears that PropertyChanged.Fody doesn't notify if you're using a ...
7
votes
1
answer
2k
views
What is the "module" keyword in C# .NET?
I am learning C# and came across the keyword module. I would like to know what this module keyword in C# is and how it is useful. For example, consider the below code:
[module: Test]
public class ...
1
vote
1
answer
1k
views
Where do I put [SuprressPropertyChangedWarnings] to suppress the build warning in WPF?
I'm getting a build warning in the Output window of Visual Studio that states:
... warning : Fody/PropertyChanged: Unsupported signature for a On_PropertyName_Changed method: OnUsersChanged in ...
2
votes
2
answers
893
views
How to include grpc_csharp_ext.x86.dll with Fody/Costura?
Looking forward to this article and issue:
1) https://idmedia.no/general/including-sqlite-interop-dll-into-your-c-project/
2) https://github.com/Fody/Fody/issues/673
Could not resolve an issue. ...
0
votes
1
answer
250
views
Adding a call to a generic method within an open generic in Fody
I'm attempting to weave a method call using Fody to fix an issue that causes some incompatibility between ReactiveUI and PropertyChanged.Fody
Now the implementation works just fine for all of my test ...
1
vote
1
answer
3k
views
Fody weaving on a referenced project?
Here is my solution structure:
-Soln
--ProjectA
--ProjectB
ProjectB is referencing ProjectA. I am trying to avoid adding the Fody nuget package to ProjectA. Is there a way to perform weaving while ...
0
votes
1
answer
106
views
NuGet references in VS
I am using fody and methodboundaryaspect.fody in this class as NuGet references. The references are installed properly but here it says that it can not find "OnMethodBoundaryAspect" which is part of ...
2
votes
0
answers
136
views
Can you include Fody in compilation generated with Roslyn?
I have some code which I want to compile at runtime. I use Roslyn to compile the code. In that code I add a Fody MethodDecorator attributes because I want to capture the object instance passed to the ...
0
votes
1
answer
829
views
Apply fody weavers to the entire solution
I'try to setup Tracer.Fody and it works perfectly when I add it to one project. However I would like to setup tracer logs for the entire solution and to configure it with only one FodyWeavers.xml. Is ...
0
votes
0
answers
259
views
Costura.Fody doesn't want to embed anything in C#, I've already done everything as shown
I installed costura.fody successfully, set the FodyWeavers.xml, yet still it doesnt say embedding (dll) in the console. I've tried launching my app and indeed it didn't embed anything. My DLLs are ...