ResGen doesn't properly declare its dependency on PrepareResourceNames
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 141
Description
It is implied that the `ResGen` target needs to run after `PrepareResourceNames`:
https://github.com/dotnet/msbuild/blob/6278211736efa2b12cd6cae38572692a44889632/src/Tasks/Microsoft.Common.CurrentVersion.targets#L2991-L2992
It is important because CoreResGen relies on the `%(ManifestResourceName)` metadata being set on the `@(EmbeddedResource)` items:
https://github.com/dotnet/msbuild/blob/6278211736efa2b12cd6cae38572692a44889632/src/Tasks/Microsoft.Common.CurrentVersion.targets#L3272
The metadata is being set in the `CreateManifestResourceNames` target:
https://github.com/dotnet/msbuild/blob/6278211736efa2b12cd6cae38572692a44889632/src/Tasks/Microsoft.CSharp.CurrentVersion.targets#L92
**However**, `ResGen` doesn't explicitly declare its dependency on `PrepareResourceNames`, and in fact, it is possible that a poorly written target can cause `ResGen` to run before `PrepareResourceNames`. Here's an example:
```
GenerateResourceToMergeWithCTO
CoreResGen
MergeCtoResource;
PrepareResourceNames;
ResGen;
CreateManifestResourceNames;
PrepareResources;
CoreBuild;
```
Here we can see that `ResGen` runs before `PrepareResourceNames`:

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.