Skip to content

SampleApp rebuilds even if no changes #3332

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

Closed
michael-hawker opened this issue Jun 6, 2020 · 1 comment · Fixed by #3558
Closed

SampleApp rebuilds even if no changes #3332

michael-hawker opened this issue Jun 6, 2020 · 1 comment · Fixed by #3558
Assignees
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior Completed 🔥 maintenance ⚙️ sample app 🖼
Milestone

Comments

@michael-hawker
Copy link
Member

Describe the bug

If you run the sample app with F5, and then later after closing it hit F5 again without making code changes, VS rebuilds the SampleApp project. ☹

Steps to Reproduce

Steps to reproduce the behavior:

  1. Clone Repo
  2. Build and Run Sample App
  3. Close Sample App
  4. Hit F5 Again

Expected behavior

Sample App Launches 'immediately'

Actual behavior

VS rebuilds Sample App Project and then runs.

Environment

NuGet Package(s): 

Package Version(s): 

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [x] May 2020 Update (19041)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] Insider Build (xxxxx)

Device form factor:
- [ ] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [x] 2019 (version: 16.6.0) 
- [ ] 2019 Preview (version: )

Additional context

Add any other context about the problem here.

@michael-hawker michael-hawker added bug 🐛 An unexpected issue that highlights incorrect behavior sample app 🖼 maintenance ⚙️ labels Jun 6, 2020
@michael-hawker michael-hawker added this to the 7.0 milestone Jun 6, 2020
mrlacey added a commit to mrlacey/UWPCommunityToolkit that referenced this issue Nov 7, 2020
@mrlacey
Copy link
Contributor

mrlacey commented Nov 7, 2020

I was investigating this problem in another app and so thought I'd contribute the fix here too.

The issue was that some .xaml files were configured to be copied to the output file. However, this was not needed and the build process already copied binary compiled versions of those files (.xbf) to the same location. The build process was looking for changes and missing output files, saw the .xaml files weren't in the output location and so triggered a rebuild to put them there.
As these xaml files did not need to be copied to the output directory I simply changed this property for the relevant files and now the app can be relaunched for debugging without requiring compilation if nothing has changed.

@ghost ghost added the In-PR 🚀 label Nov 7, 2020
@ghost ghost closed this as completed in #3558 Nov 9, 2020
ghost pushed a commit that referenced this issue Nov 9, 2020
…ed (#3558)

<!-- 🚨 Please Do Not skip any instructions and information mentioned below as they are all required and essential to evaluate and test the PR. By fulfilling all the required information you will be able to reduce the volume of questions and most likely help merge the PR faster 🚨 -->

## Fixes #3332
<!-- Add the relevant issue number after the "#" mentioned above (for ex: Fixes #1234) which will automatically close the issue once the PR is merged. -->

<!-- Add a brief overview here of the feature/bug & fix. -->

Stop the sample app from always triggering a rebuild, even if no code has been changed.

## PR Type
What kind of change does this PR introduce?
<!-- Please uncomment one or more that apply to this PR. -->

<!-- - Bugfix -->
<!-- - Feature -->
<!-- - Code style update (formatting) -->
<!-- - Refactoring (no functional changes, no api changes) -->
<!-- - Build or CI related changes -->
<!-- - Documentation content changes -->
<!-- - Sample app changes -->
 - Other... Please describe: Change in compilation behavior of the Sample App


## What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->

VS will always rebuild the sample app when launched for debugging.

## What is the new behavior?
<!-- Describe how was this issue resolved or changed? -->

Now VS will only rebuild the code if something has changed.

## PR Checklist

Please check if your PR fulfills the following requirements:

- [ ] Tested code with current [supported SDKs](../readme.md#supported)
- [ ] Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->
- [ ] Sample in sample app has been added / updated (for bug fixes / features)
    - [ ] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets)
- [ ] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [ ] Header has been added to all new source files (run *build/UpdateHeaders.bat*)
- [x] Contains **NO** breaking changes

**All unchecked options above are not applicable**

<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. 
     Please note that breaking changes are likely to be rejected within minor release cycles or held until major versions. -->


## Other information
@ghost ghost added Completed 🔥 and removed In-PR 🚀 labels Nov 9, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 9, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior Completed 🔥 maintenance ⚙️ sample app 🖼
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants