GithubHelp home page GithubHelp logo

Comments (10)

tom-englert avatar tom-englert commented on June 10, 2024 1

@richardhauer to me this looks good, should not have any side effects.
Can you provide a PR with this change?

from fody.

SimonCropp avatar SimonCropp commented on June 10, 2024

it was to fix this issue #349

from fody.

SimonCropp avatar SimonCropp commented on June 10, 2024

i would not like to use 'DesignTimeBuildto inferLive Unit Testing` since that would seem to be a side effect.

from fody.

richardhauer avatar richardhauer commented on June 10, 2024

While DesignTimeBuild property does not imply LUT, the reverse is true - LUT does have the DesignTimeBuild property set, at least, removing the condition allows Fody to work in LUT.

WRT #349 it seems that blocking Fody for all design-time builds might be too broad. There may be a more specific way to get Fody to play nicely with NServiceBus and still work for LUT. Perhaps @davkean could be drawn on this topic?

In his linked document on the subject, @davkean states that:

Targets that dynamically change references, source files or compilation options must run during design-time builds to avoid unexpected behavior in Visual Studio.

... and seeing as this is the whole job of Fody it would seem (to me) that is exactly when it should be running. In which case a deeper look at the original problem in #349 might reveal an alternative, more specific approach to addressing the issue.

from fody.

davkean avatar davkean commented on June 10, 2024

Design-Time builds don't produce binaries, Fody runs on top of a binary. Therefore cannot run in design-time builds.

from fody.

richardhauer avatar richardhauer commented on June 10, 2024

@davkean Ah ok; is there a way you might suggest we can get Fody to work in an LUT scenario without resorting to removing the And $(DesignTimeBuild) != true condition clause? That's the real goal. There's very little information around on how the LUT system works, from what I've been able to find.

from fody.

davkean avatar davkean commented on June 10, 2024

See: https://docs.microsoft.com/en-us/visualstudio/test/live-unit-testing-faq?view=vs-2019#customize-builds.

from fody.

richardhauer avatar richardhauer commented on June 10, 2024

Righto. So update the condition to something along the lines of this?

Condition="Exists(@(IntermediateAssembly)) And ($(DesignTimeBuild) != true Or $(BuildingForLiveUnitTesting) == true) And $(DisableFody) != true"

Exclude Fody from the build chain if DesignTimeBuild unless also BuildingForLiveUnitTesting ?
@SimonCropp I can confirm that my LUT does work when the Condition attribute is updated as above. I suspect this will allow both the LUT case and the NServiceBus case to work, though I don't have a way to test the latter.

from fody.

richardhauer avatar richardhauer commented on June 10, 2024

@tom-englert please see PR #1037

from fody.

SimonCropp avatar SimonCropp commented on June 10, 2024

thanks everyone for all the help. i will deploy this now

from fody.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.