Comments (8)
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.
Can it be true that I've been the first one to notice this`?
(I reported in #9440)
from project-system.
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:
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.
@merriemcgaw FYI, as this has potential impact for WinForms users migrating to .NET Core.
@rainersigwald have you seen this before?
from project-system.
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.
@JeremyKuhne and @lonitra for visibility.
from project-system.
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.
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)
- Support custom metadata for AvailableItemName HOT 3
- Flaky: New json files in project directories aren't shown in the Solution Explorer consistently HOT 1
- Unexplained warnings while trying to add System.Web reference HOT 3
- Pipeline template updates
- SDL Renewal - March 2024
- Consider adding "send feedback" on property menu in Project Properties UI HOT 1
- Properties page is blank after close and reopen solution while current tab is not Properties page HOT 3
- PackageReference added under Target is not displayed in Dependency Tree HOT 1
- Visual Studio Build Acceleration not respecting "Copy Local" setting on dependencies. HOT 7
- Inconsistent copy of transitive assembly references with FastUpToDate build HOT 4
- Support TargetPath and Link metadata on CopyToOutputDirectory items in Properties window
- Copies performed by the Build Acceleration feature should trigger the PostBuild event HOT 1
- Replace occurrences of AsyncSemaphore with JTF-aware semaphore
- Move to Archive Symbols task v4 for servicing branches
- Update Build Acceleration documentation around opt-in/out
- FUTDC doesn't check packed items when GeneratePackageOnBuild is true HOT 6
- VS FUTDC is not considering updates to file-based resources HOT 13
- Generation of Application.myapp while Visual Basic Application Framework is disabled HOT 3
- Support for file nesting for legacy projects HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from project-system.