-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build Accelertion - appsettings.json edits not picked up when debugging #8928
Comments
Added a test project on Github to reproduce this issue: https://github.com/AndyStevenson7/Test_BuildAcceleration_ConfigChange |
Hi @AndyStevenson7. Thanks for the detailed report, and for the repro repo! When I clone your repo and follow the above steps, I see that a build is in fact triggered:
The key line is:
Note that the project is then actually built. Further, the Note that your project does not actually enable Build Acceleration. When I enable it, I see that acceleration occurs as expected.
Could you please enable verbose logging for the up-to-date check and share your logs here? |
Note that your project actually uses a <ItemGroup>
<None Remove="appsettings.json" />
</ItemGroup>
<ItemGroup>
<Content Include="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup> Though even if I have it as a <ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup> |
@AndyStevenson7 I think the problem you're experiencing is actually elsewhere. It seems there's a bug where using F5 to build completely skips any kind of up-to-date check. You can see, for example, there's no build summary in the Output window as there normally would be. I've reported this internally. If you build the project before pressing F5, does the project work correctly for you? Obviously this is not idea, but it would confirm that you're hitting the same issue. |
Here's a feedback ticket for the issue you're seeing. I'll close this as a duplicate of that ticket (if you believe it's not a dupe, let me know and we can re-open this, but I'm quite sure it's what you're seeing.) https://developercommunity.visualstudio.com/t/Copy-if-newer---Issue-when-only-non-sour/10308822 You might like to vote on that ticket to help it gain priority. |
Hey @drewnoakes My issue does look like a duplicate of the one you listed above (10308822), so I'll track the progress on it. Many thanks |
To answer your question: if I build before pressing F5 it works as expected. The issue seems to be that a resource marked with |
Thank you for confirming. That does sound like the same bug. It's currently with another team, so that feedback ticket is the best place to track it. |
@AndyStevenson7, following up on this, in the end we decided to make a workaround in this repo to address this bug. Fixed in #9130 which should make 17.7 preview 3. Thanks again for filing this, and for your patience. |
@drewnoakes thanks for the feedback! |
Visual Studio Version
17.5.2
Summary
With Build Acceleration enabled, when I edit a config setting in appsettings.json and run in debug, the compiler does not pick up the change, unless I first run a build. The default Build Action on a settings file is 'None'. If I set this to 'Embedded Resource' then it seems to work.
Steps to Reproduce
Expected Behavior
Edits to a setting file should be picked up by the compiler
Actual Behavior
The setting change is not picked up by the compiler
User Impact
Any new projects with a settings file added, that defaults to Build Action: None may cause confusion when testing in debug mode, for example, changing connections to databases, API endpoints etc.
The text was updated successfully, but these errors were encountered: