by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Dan Bourquin
    @bourquin.dan_gitlab
    <PackageReference Include="PropertyChanged.Fody" Version="3.2.6"> <PrivateAssets>all</PrivateAssets> </PackageReference> Is this ok too?
    Geert van Horrik
    @GeertvanHorrik
    I always put it on the line itself, but looks good
    Dan Bourquin
    @bourquin.dan_gitlab
    But I've still reference on my deps.json. Maybe my problem is elsewhere.
    Geert van Horrik
    @GeertvanHorrik
    could be a project lower in the chain
    check all projects, they should all have private assets
    Dan Bourquin
    @bourquin.dan_gitlab
    I have only one project is this solution
    Geert van Horrik
    @GeertvanHorrik
    I could help you with remote support (or @SimonCropp can, don't want to take his support work from him), but that's paid services
    Dan Bourquin
    @bourquin.dan_gitlab
    I have to ask my boss about it
    Dan Bourquin
    @bourquin.dan_gitlab
    Do you think it could be related to the usage of "Packages.config" as default package management format?
    Geert van Horrik
    @GeertvanHorrik
    don't know, it also support sprivate assets if I am not mistaken
    Dan Bourquin
    @bourquin.dan_gitlab
    It's weird. Even on a new project when including PropertyChanged.Fody and adding the "PrivateAssets=all" it remains on deps.json. Maybe something is wrong with my VS.
    Geert van Horrik
    @GeertvanHorrik
    the weaver should remove itself as reference once executed
    PrivateAssets should remove it from deps.json
    Dan Bourquin
    @bourquin.dan_gitlab
    Thank for your help. I should had use publish and not build and it work fine. (even if the deps.json contain some information about the NuGet)
    ndrwrbgs
    @ndrwrbgs
    How can I run Fody on all dlls in my output directory?
    Vishal Bhatt
    @bhattvishal
    I am not able to build my project in Visual Studio 2017/2019, if I use Fody. It takes forever to build and I can't even cancel the build. Can anybody help?
    ShannonZ
    @ShannonZ
    How to use BeforeAfter[https://github.com/Fody/PropertyChanged/wiki/BeforeAfter] in a inherited class? there was no PropertyChanged.
    class InheritedClass:BaseClass, some new props have been added to InheritedClass. Now how to capture the values before&after propertyChanged event?
    Lucas Trzesniewski
    @ltrzesniewski
    @ndrwrbgs That's not how this works. You need to install and configure Fody and the addins you need in each project.
    @bhattvishal VS2017 is no longer supported with recent versions, so make sure you're using VS2019. That "forever to build" issue is strange though, you may try disabling addins to see which one causes the issue.
    Lucas Trzesniewski
    @ltrzesniewski
    @ShannonZ this should work fine with inherited classes - the method from the base class should get called with the old and new values. If you can't get it to work, try to submit a minimal repro as an issue.
    Vishal Bhatt
    @bhattvishal
    @ltrzesniewski Thanks for responding. I am using a pretty old version of Fody (2.1.2 to be accurate, PropertyChange.Fody 2.1.3), It was working fine until a week before, but now it just does not compile and takes infinite time. This is happening with every single person in my team, it seems to be some anti-virus thing as we all are in using it in our corporate machines. Fody Property Change tries to change the assemblies, one more thing this is happening only with projects that produce .exe as an output. Do you know, if there's any workaround, also the MSbuild.exe locks the fody.dll and we are not able to close the VS.
    Vishal Bhatt
    @bhattvishal
    This is exactly the issue we are facing - https://stackoverflow.com/questions/59603131/msbuild-hangs-forever-when-fody-writes-assembly any help will be greatly appreciated, we are not able to find any breakthrough. @SimonCropp @ltrzesniewski
    Lucas Trzesniewski
    @ltrzesniewski
    @bhattvishal hmm did you by any chance update VS to v16.5? I know it has issues with older version of Fody. But if that's an antivirus issue, I'm afraid there's not much we can do. Try to add an exclusion rule, or report an issue to your antivirus vendor.
    ShannonZ
    @ShannonZ
    @ltrzesniewski I has a lot of child classes (Class1.cs Class2.cs etc) inherited from BaseClass. I want to check the property in the inherited classes. i.e. Check Class_X's properties in Class_X.cs. How to implement this? I can capture all propertychanged event in BaseClass but if that the code will be too long.
    sekulicb
    @sekulicb
    Hi. How to reset validation errors in Validar, once the form is validated and saved. If we clear previous data, the user is presented with adorned boxes making form all in red next time the form is opened. Is there a way to revert all validation errors and clear the form from red borders? Thanks
    Simon Cropp
    @SimonCropp
    @ndrwrbgs yep fody only runs on the assembly produced by the csproj
    Simon Cropp
    @SimonCropp
    @sekulicb you need to provide a repro that illustrates what you are trying to achieve
    @bhattvishal you need to provide a repro that illustrates the problem
    Dan Siegel
    @dansiegel
    hey @SimonCropp I might be jumping into the deep end here... but hoping you can help point me in the right direction... I get how to walk the types, methods and properties in a compiled assembly... but what I'm trying to figure out is the correct way to build the new instruction I want to weave in...
    public void SomeMethod(ISomeService someService)
    {
        // What needs to be weaved...
        SomeGeneratedMethod(someService);
    }
    
    private void SomeGeneratedMethod(ISomeService someService)
    {
        // Generated Code
    }
    Simon Cropp
    @SimonCropp
    @dansiegel your best bet is to look at the method u want to in ilspy. that will show u what instructions to inject
    Dan Siegel
    @dansiegel
    thanks I'll check that out
    Kevin B
    @Keboo
    @dansiegel another thing I have done is leverage dnSpy since it lets you inspect an assembly and then mutate its contents either in IL or C#. Makes for a tighter development loop.
    Dan Siegel
    @dansiegel
    thanks @Keboo appreciate the tips
    Simon Cropp
    @SimonCropp
    @dansiegel is it an OSS project?
    Dan Siegel
    @dansiegel
    this one isn't... doing it as a project for my GitHub sponsors... and OSS authors who ask ;)
    Simon Cropp
    @SimonCropp
    fair enough. was going to offer to review it.
    Dan Siegel
    @dansiegel
    there really isn't much there right now... still trying to get a working prototype now that I finished the code gen side
    but I'm happy to invite you to the project
    Simon Cropp
    @SimonCropp
    ok
    GioviQ
    @GioviQ
    Geert van Horrik
    @GeertvanHorrik
    @GioviQ not for me, since it does not allow replacement of existing user code (e.g. rewrite public string FirstName { get; set; } as a dependency property).
    So people will end of with all kinds of hacks (e.g. define a field and dynamically add a property for that), but I think that experience is worse than Fody where you can at least write regular properties (or anything else you would prefer). So it might work great for some weavers, not for all of them
    Simon Cropp
    @SimonCropp
    @GioviQ looking at the existing ~50 actively maintained weavers, i think there are 3 that could be changed to source generators.
    Dan Siegel
    @dansiegel
    @GioviQ Source Generation is pretty awesome and has some benefits over IL weaving with Fody... however to give you an idea... there are limitations with Code Generation that mean you're going to have to look at ways to generate code and then use IL weaving to hook into your generated code.. and there's a lot that just can't be done very well at all with Code Gen...
    kind of where I'm at right now... if I can figure out how to call a method and pass a parameter lol
    Kevin B
    @Keboo
    @dansiegel if you want some assistance I am happy to help as well. In general the IL should look something like: push instance of source object (if static method, omit this) onto the stack, push all arguments onto the stack, invoke method with either call/callvirt depending on the type of method you are trying to invoke.
    The other common problem is forgetting to call ImportReference on everything (types/methods) you want to use.
    Dan Siegel
    @dansiegel
    @Keboo I'd be happy to take you up on that... right now I feel like a total idiot not being able to figure out something that should be pretty basic haha
    Simon Cropp
    @SimonCropp
    @dansiegel i feel like an idiot most of the time when playing with IL. i mostly use decompilers to help me paint by numbers
    ndrwrbgs
    @ndrwrbgs
    @SimonCropp and @ltrzesniewski , I know that's the standard scenario, but given that I was at one point having issues with code signing happening before fody, I'm led to believe that fody is operating on the completed binary. Therefore shouldn't it be possible to run it post-hoc on other assemblies?