Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    slim16165
    @slim16165
    The section "Adding Fody to a project that generates a NuGet package" isn't clear to me. What happens if I don't modify the nuget configuration file? And why it speaks of .nupkg file? It means the packages.config?
    A last question is about FodyWeavers.xml
    If I don't create this file Fody won't work?
    Isn't the guide a bit too much brief?
    Geert van Horrik
    @GeertvanHorrik
    If you use the old package format, it's indeed the same. In the new sdk format which is strongly recommended, you can set PrivateAssets to all so Fody won't show up as a dependency (it's a development dependency, not a runtime dependency)
    FodyWeavers is the configuration for the weavers that are ran by Fody. So Fody itself is just the "weaver runner", where each weaver implements specific functionality. So whenever you want a feature (weaver), you:
    1. Install the weaver
    2. Add it to FodyWeavers.xml (and customize the documentation)
    Mike Marynowski
    @mikernet
    Are Fody weavers supported for libraries that use Source Link? Someone is having an issue where source link no longer works when my weaver is used, it says "Source Not Available", trying to figure out how to debug this
    Weaved libraries can be debugged just fine when the library solutions are opened in VS so I think I'm updating pdb/debug info correctly
    It seems when they are referenced via nuget the source link portion no longer works
    Mike Marynowski
    @mikernet
    So it seems that fody is supposed to work with source link. Not entirely sure on how I go about debugging this.
    Geert van Horrik
    @GeertvanHorrik
    Correct, if I remember correctly Mono.Cecil (which does the actual assembly / pdb writing) takes care of this. And since the assembly is modified, so is the pdb file.
    The only thing that might happen is that some instructions (such as injected method timers) cannot be found in the source files. So when debugging, it depends on how much the weavers actually changed the IL from the source logic.
    Mike Marynowski
    @mikernet
    image.png
    It says it is missing from the module
    Let me see if this is an issue with only my weaver or any weaver
    tom-englert
    @tom-englert
    @mikernet I never had any issues with Source Link & Fody
    Geert van Horrik
    @GeertvanHorrik
    If you weaver injects (generates) code, then the source code is "not available"
    so I think it totally depends on what your weaver does
    Christopher Dresel
    @Dresel

    We experienced that within a solution a ProjectA referencing properties from ProjectB (weaved by virtuosity) might emit call instead callvirt instructions when using the coalesce operator. Is this a known issue?

    Just ran into this because EF lazy loading was not triggering for something like entity?.OtherEntity :(

    Mike Marynowski
    @mikernet
    So after banging my head against the wall for hours, I traced the source link issue to updating debug sequence points after calling OptimizeMacros() instead of before, which makes no sense to me whatsoever.
    You would think updating the debug sequence points after optimizing macros would make more sense, given that the instructions could change during the OptimizeMacros() step
    Mike Marynowski
    @mikernet
    Oh....I see....OptimizeMacros() seems update offsets of the sequence points. Blarg. Well at least it works now.
    GFHuang
    @GF-Huang
    Hi everyone. For Fody/PropertyChanged, how can I suppress the notify property changed temporary and resume it later?
    Simon Cropp
    @SimonCropp
    @GF-Huang implemetn your own onpropertychanged method, then u can swallow events using a flag
    @all thoughts on moving to github discussions? it could be enables in the Fody/Home repo
    GFHuang
    @GF-Huang

    @all thoughts on moving to github discussions? it could be enables in the Fody/Home repo

    Agree

    tom-englert
    @tom-englert

    @all thoughts on moving to github discussions? it could be enables in the Fody/Home repo

    :+1:

    spricesoft-samuel
    @spricesoft-samuel
    Hi. I'm trying to write a new add-in that adds new method overloads to classes but finding documentation hard to find. There seems to be almost no guides on how to do this. Could someone please point me to some decent documentation on this?
    Geert van Horrik
    @GeertvanHorrik
    There are a lot of open source weavers, I think it's much easier to see the examples and go from there
    Lucas Trzesniewski
    @ltrzesniewski
    But really, you mostly need knowledge about Cecil
    happosai74
    @happosai74
    hey there guys someone can point me how to solve the error
    "Fody: No weavers found. Add the desired weavers via their nuget package."

    Installed the packages Fody/ReactiveUI/ReactiveUI.Fody and added the FodyWeavers.xml to the root of project with the content : <?xml version="1.0" encoding="utf-8" ?>

    <Weavers>
    <ReactiveUI/>
    </Weavers> Am i missing something else?

    Mike Marynowski
    @mikernet

    When I run my Fody weaver on net472, I get the following in build output:

    Fody/RuntimeNullables: Reference to attribute library not found - references remain unchanged.

    I tested it with NullGuard and a similar issue happens:

    Fody/NullGuard: No reference to 'NullGuard.dll' found. References not modified.

    And the bin output folders contain the attribute assemblies. This does not happen on netstandard or netcore projects.

    Mike Marynowski
    @mikernet
    It seems that searching through ModuleDefinition.AssemblyReferences by name doesn't work on net472 for some reason.
    Mike Marynowski
    @mikernet
    It seems to work fine in the tests, so debugging there isn't particularly helpful, but when I create a new net472 winforms project and add NullGuard that message appears and the attribute assembly gets dumped into the bin folder.
    Whether it is a new SDK style csproj or a legacy style one doesn't seem to make a difference. I can make the problem happen on both.
    Mike Marynowski
    @mikernet
    The only difference seems to be that the weaver is added as a nuget package in the projects that have the problem
    Lucas Trzesniewski
    @ltrzesniewski
    @mikernet It looks like you're trying to remove the references by yourself. Try to let Fody handle it by adding public override bool ShouldCleanReference => true; in your ModuleWeaver
    (Fody has an additional MSBuild target that updates the list of files that are supposed to end up in the build output)
    (if you need to change additional build outputs, you can update the ReferenceCopyLocalPaths property of your weaver)
    Mike Marynowski
    @mikernet
    @ltrzesniewski Thanks, that seems to work. NullGuard has the same issue so it would probably be a good idea to update that.
    Lucas Trzesniewski
    @ltrzesniewski
    Thanks, you're right, I submitted a PR for this here: Fody/NullGuard#453
    Gaute Løken
    @gautelo
    I'm getting these warnings produced by https://github.com/Fody/Fody/blob/ff2250bb097d5b2d53e7743cff6491cfde219b09/FodyIsolated/InnerWeaver.cs#L103. Does this mean I'm using it wrong, or is this normal? I would have preferred a clean build output, and this is indicating that there is a problem...
    Lucas Trzesniewski
    @ltrzesniewski
    @gautelo That's not normal, you probably have a build issue somewhere.
    Gaute Løken
    @gautelo
    @ltrzesniewski Ok. I'll look a bit closer then. Thanks.
    Michael Fyffe
    @TraGicCode

    Can anyone help explain why my nuget package for my new fody plugin isn't being created? I'm following the instructions at https://github.com/Fody/Home/blob/master/pages/addin-development.md and it sounds like i just need to run the following

    dotnet build .\MyTest.Fody.sln --configuration Release

    And it should be created in a "nugets" folder at the root of the solution but that is not what i see

    Michael Fyffe
    @TraGicCode

    hmm....had to add the following to my csproj's xml to get it to automatically create the nuget package

    <PackageOutputPath>$(SolutionDir)../nugets</PackageOutputPath>

    Michael Fyffe
    @TraGicCode
    Forgive me as i'm new to fody and attempting to learn. I have ApplicationA that i wrote that references a public nuget package B. I want my fody plugin to take a custom attribute that lives in nuget package B and add it to methods in ApplicationA. Unfortunately, it looks like if ApplicationA uses no types from nuget package B msbuild sees this and actually causes the assembly to not show up when i enumerate AssemblyReferences in my ModuleWeaver. Is there any good way to handle this?