question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a way to associate inputs and outputs in FastUpToDate

See original GitHub issue

Visual Studio Version: 16.4 Preview 2.0

Summary:

Linked ASP.NET Core issue: https://github.com/aspnet/AspNetCore/issues/13204

ASP.NET Core projects produce two compiled outputs: .cs files (et al) produce an App.dll, .cshtml files produce an App.Views.dll. When a cshtml file changes, App.dll remains unchanged, but a newer App.Views.dll needs to be compiled.

To allow a build to occur when cshtml files change, ASP.NET Core projects (via the Microsoft.NET.Sdk.Razor SDK), add cshtml files to UpToCheckInput. Fast UpToDateCheck is now aware of these files and rebuild when these files change. However doing so also leaves FastUpToDateCheck in an incosistent state - the input .cshtml file is always newer than the output MyApp.dll and consequently fast up to date check is broken until a user touches a cs file.

Feature request: The feature request was to have a way to associate inputs and outputs in FUTD. By default, everything would be associated with the default UpToDateCheckBuilt. However, Inputs would have a way to state that they specifically affect certain outputs. When FUTD runs, it correlates these and uses this to perform the dirty check.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:22 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
drewnoakescommented, Oct 29, 2019

@rainersigwald thanks for the fix. Thankfully the horror will be contained within a local test project.

@pranavkm once the PR is up you’ll be able to F5 this repo to get the change into the Exp hive for further testing.

I asked @panopticoncentral about the difference between UpToDateCheckOutput and UpToDateCheckBuilt and the conclusion was that it’s historical. As part of the PR I’m preparing I’ll update our docs to improve our guidance on these features. I’ll be sure to include that information too, and suspect we can effectively deprecate UpToDateCheckOutput.

2reactions
rainersigwaldcommented, Oct 29, 2019

It’s getting lucky 😦 (microsoft/msbuild#2835 for context)

@drewnoakes use something like this instead:

<Target Name="U2D" BeforeTargets="Compile">
  <ItemGroup>
    <UpToDateCheckInput Condition=" '%(Extension)' == '.cshtml' " Set="Views" />
    <UpToDateCheckBuilt Condition="$([System.String]::Copy(%(Identity)).EndsWith('.Views.dll'))" Set="Views" />
  </ItemGroup>
</Target>

(I know the String.Copy thing there is a horror: microsoft/msbuild#1155)

Read more comments on GitHub >

github_iconTop Results From Across the Web

project-system/docs/up-to-date-check.md at main
Up-to-date Check. The Project System's Fast Up-to-Date Check (FUTDC) saves developers time by quickly assessing whether a project needs to be built or...
Read more >
How to execute msbuild (csproj) targets based on input ...
I'm required to add a target to my csproj file which specifies input files as well as output files. Going by this link,...
Read more >
How to create custom project file that works with fast-up- ...
Here is how to do it: <Project Sdk="Microsoft.Build.NoTargets/3.2.14"> <ItemGroup> <PackageReference Include="Microsoft.Build.
Read more >
Visual Studio 2019 Always Rebuilds Up-To-Date Projects
If it still not works, please go to Tools -> Options and choose Projects and Solutions -> Build and Run and select Diagnostic...
Read more >
Incremental T4 Text Templating - benjamin.pizza
It works by looking at the timestamps of the project's input and output files; if all of the output files are newer than...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found