Repository navigation
Closed
Labels
Description
📝 I'm not sure where this bug lies, but @srivatsn suggested I start by posting it here.
Steps to reproduce
-
Open AsyncUsageAnalyzers.sln in Visual Studio 2017 15.3 Update 4
-
Right click the AsyncUsageAnalyzers project → Edit AsyncUsageAnalyzers.csproj
-
Open Directory.build.targets
-
Modify the existing code which updates designer files to also set the
DesignTimeandAutoGenmetadata:<Compile Update="**\*.Designer.cs"> <DesignTime>True</DesignTime> <AutoGen>True</AutoGen> <DependentUpon>$([System.IO.Path]::ChangeExtension($([System.IO.Path]::GetFileNameWithoutExtension(%(Identity))), '.resx'))</DependentUpon> </Compile>
-
Add the following lines to Directory.build.targets:
<ItemGroup> <EmbeddedResource Update="**\*.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>%(Filename).Designer.cs</LastGenOutput> </EmbeddedResource> </ItemGroup>
-
Save the changes to Directory.build.targets
Expected results
No changes are made to AsyncUsageAnalyzers.csproj.
Actual results
The following block is added to AsyncUsageAnalyzers.csproj:
<ItemGroup>
<Compile Update="Helpers\HelpersResources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>HelpersResources.resx</DependentUpon>
</Compile>
<Compile Update="Naming\NamingResources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>NamingResources.resx</DependentUpon>
</Compile>
<Compile Update="Reliability\ReliabilityResources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>ReliabilityResources.resx</DependentUpon>
</Compile>
<Compile Update="Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Update="Usage\UsageResources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>UsageResources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Helpers\HelpersResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>HelpersResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Naming\NamingResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>NamingResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Reliability\ReliabilityResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>ReliabilityResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Usage\UsageResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>UsageResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
Activity
rainersigwald commentedon Jul 26, 2017
Just tried this, and it appears to only happen when the new project system's "edit project file" window is open. Since that window does some trickery with multiple files and evaluation states for the project, I bet what we're seeing is torn state between the project instances resulting in CPS wanting to fix up the project file to match the observed state.
It looks like that functionality has recently moved into CPS, so I'm moving this to internal bug: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/470015.
ltrzesniewski commentedon Jan 14, 2019
This happens all the time for me in VS 15.9.5, even if the project file edit window is closed, as soon as a single-file generator of any kind is involved from what I can tell.
As I don't have access to that internal link, can you give a status update on this @rainersigwald? Thanks.