Coder Social home page Coder Social logo

Comments (3)

jeffkl avatar jeffkl commented on August 24, 2024 1

Since Directory.Packages.props is imported by MSBuild, it gets added to the MSBuildAllProjects property. If any MSBuild import is newer than the output of a project then it will rebuilt due to this declaration. Unfortunately, this is by design at the moment. A user could place any MSBuild logic in Directory.Packages.props that actually affects the compilation such as adding a new target that needs to run.
For example, I add this to my Directory.Packages.props:

<Target Name="MyCustomTarget" BeforeTargets="CoreCompile">
  <Message Text="Example" />
</Target>

If the CoreCompile target didn't consider $(MSBuildAllProjects) as an input, my projects won't re-run compilation and I would be scratching my head. Obviously, sometimes its desirable to trigger a rebuild and sometimes it isn't. But editing an MSBuild import currently always triggers a rebuild.

from home.

martinrrm avatar martinrrm commented on August 24, 2024

@jeffkl Can you help me triage this issue? I'm not sure if this is something we already have planned

from home.

MarkKharitonov avatar MarkKharitonov commented on August 24, 2024

The rationale and the mechanism of it is totally clear to me. However, it may not be clear to all who read the CPM documentation and do not realize this regression in the behavior of a common scenario - a NuGet version is changed for a package. Before CPM only the touched project and its dependents are recompiled. When using CPM it is the entire solution. For big solutions containing unit test projects (which usually do not carry a lot of dependents) this is a big deal, as any change in the versions of the packages consumed by the unit tests, will now recompile all the business logic.

The CPM documentation should indicate that and provide workarounds, e.g. structuring the solution in a way that consolidates all the unit tests under a single folder and allows for a hierarchy of Directory.Packages.props files.

But not everything can be resolved with restructuring, so the side effect of recompiling it all is there all the time.

At least this should be emphasized.

from home.

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.