Giter VIP home page Giter VIP logo

Comments (8)

drewnoakes avatar drewnoakes commented on June 2, 2024 1

Can it be true that I've been the first one to notice this`?

I won't say you're the first to experience the issue, but this is certainly the first I've heard about it.

from project-system.

softworkz avatar softworkz commented on June 2, 2024

Can it be true that I've been the first one to notice this`?
(I reported in #9440)

from project-system.

drewnoakes avatar drewnoakes commented on June 2, 2024

Triage notes:

This problem also occurs on the command line. Having Program.cs print out the resource to the console and running...

> echo updated >> LinkedFile.txt
> dotnet run
prior

...will print out the old version, not the new one. So this issue isn't limited to VS. Note however that forcing a rebuild does cause the value to be picked up:

> msbuild -t:Rebuild
> dotnet run
updated

As for a potential fix, files linked into .resx files are not available during design-time builds, so we'd either have to add that to DTBs (potentially regressing DTB perf) or find some other route for the data to reach the FUTDC. Looking at binlogs from the rebuild above shows:

image

i.e. nothing during the rebuild, related to resource generation, looks at the None input item. This will be why the problem exists on the command line as well. Only during a rebuild will the embedded item be picked up within the GenerateResource task. Linked files are not inputs to that task or its targets.

Note that GenerateResource exists in MSBuild's targets, not the SDK. So I'm unclear on how this could work for legacy projects either, given that linked files aren't inputs to the target. Perhaps the target always runs (it doesn't declare any inputs/outputs as far as I can see).

from project-system.

drewnoakes avatar drewnoakes commented on June 2, 2024

@merriemcgaw FYI, as this has potential impact for WinForms users migrating to .NET Core.

@rainersigwald have you seen this before?

from project-system.

rainersigwald avatar rainersigwald commented on June 2, 2024

Perhaps the target always runs (it doesn't declare any inputs/outputs as far as I can see).

It does, and the task has its own internal state lookup that tries to account for this case. Sounds like that's going awry here.

Can FUTDC inputs come from a full build or are they all computed at design time? I'm wondering if we should add an output to GenerateResource that lists the linked files we found so you can account for them on the next round.

from project-system.

merriemcgaw avatar merriemcgaw commented on June 2, 2024

@JeremyKuhne and @lonitra for visibility.

from project-system.

drewnoakes avatar drewnoakes commented on June 2, 2024

Can FUTDC inputs come from a full build or are they all computed at design time? I'm wondering if we should add an output to GenerateResource that lists the linked files we found so you can account for them on the next round.

We only pull data from design-time builds. I think anything we did here would likely regress perf due to resx file parsing, and be a non-starter on that basis.

The work being done on improving resx editing does eagerly parse resx files and might be able to flow data into the FUTDC via a different channel. We'd have to think about it.

I can't see a great path forward here, so I'd like to understand the impact of the problem. It's existed for a long time and we haven't had reports about it, but that doesn't mean people don't struggle with this.

from project-system.

softworkz avatar softworkz commented on June 2, 2024

I'd like to understand the impact of the problem. It's existed for a long time and we haven't had reports about it, but that doesn't mean people don't struggle with this.

I don't think this can be pushed away on the basis of "impact" consideration. It has always worked (in .netframework projects) and is clearly something that is suppposed to work. The MSBuild documentation leaves no doubt about it:

Because .resx files may contain links to other resource files, it is not sufficient to simply compare .resx and .resources file timestamps to see if the outputs are up to date. Instead, the GenerateResource task follows the links in the .resx files and checks the timestamps of the linked files as well. This means that you should not generally use Inputs and Outputs attributes on the target containing the GenerateResource task, as this may cause it to be skipped when it should actually run.
(https://learn.microsoft.com/en-us/visualstudio/msbuild/generateresource-task)

If the FUTDC doesn't handle it properly, then it's a bug.

A question of interest might be how the FUTDC in netframework projects is doing this..

from project-system.

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.