-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Cannot update an imported file within a build #1185
Comments
I don't know why the default cache is constructed with It seems like the fix here is to check timestamps by default. |
@rohit21agrawal this might be relevant to you too |
Closes dotnet#1185 Allowing a once-read imported file to be updated during the build enables a carefully-crafted build process to do a NuGet restore and a build in the same MSBuild invocation.
Comments from standup today:
|
👍! |
Discovered additional considerations here after talking with some folks on the Live Unit Testing team. They are deliberately taking a snapshot of a set of projects by loading them into the cache, and relying on that to ensure that project-to-project references see a consistent view of the world, even while the user is typing. Unfortunately, we now have conflicting desires: this issue, and the ability to take a snapshot. Since the legacy behavior allowed the LUT folks to get snapshots, I'm going to defer to that, meaning we can't solve this the "easy way" I proposed in the PR and need a more sophisticated design. |
Hm. How about an explicit property (that doesn't sound as"scary" as On Mon, Nov 21, 2016, 2:21 PM Rainer Sigwald notifications@github.com
/kzu from mobile |
Team triage: this is not really feasible. Closing. |
This was reported offline by @kzu. Thanks!
In this situation:
.sln
build).The builds in step 4 do not pick up the new versions of files updated by step 3--they continue to use the file contents from their original form read in step 2.
This breaks multi-step restore + build in a single invocation, even though the evaluation and builds are separated by being in different global property spaces.
This is happening because of caching of imported file contents done by
ProjectRootElementCache
. The cache can be set to invalidate its entries based on file timestamp checks by constructor argument, but this is not done by the relevant call in a command-line build, from this callstack:There's no way to specify that the cache should check for updated targets within a build. Flipping that bit with a debugger produces the expected result (from the
MSBUILDDEBUGXMLCACHE=1
debug log):The text was updated successfully, but these errors were encountered: