Skip to content
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

Assembly version stopped being bumped with every build in 2.1.300+ #2953

Closed
nguerrera opened this issue Feb 16, 2019 · 4 comments · Fixed by #3340
Closed

Assembly version stopped being bumped with every build in 2.1.300+ #2953

nguerrera opened this issue Feb 16, 2019 · 4 comments · Fixed by #3340
Assignees
Labels
Milestone

Comments

@nguerrera
Copy link
Contributor

nguerrera commented Feb 16, 2019

MSBuild on desktop cannot load more than one version of our tasks unless we bump the assembly version. (MSBuild on coreclr can't either, but we have a 1:1 msbuild:sdk relationship on coreclr so it's moot. The current limitations on coreclr are even worse, can't load SxS in same load context regardless of version, but again moot here.)

If an MSBuild node is alive using a different build of the same Major.Minor.Patch release, then it will use targets from the new build and tasks from the old one. When there are contract changes between the tasks and targets, this can lead to confounding errors like "task X could not be loaded from Microsoft.NET.Build.Tasks.dll" or "task Y does not take parameter Z".

We got around this in the past by bumping the assembly version with every build. Since tasks are always dynamically loaded and never referenced directly at compilation time, this doesn't have the usual negative consequences of requiring excessive binding redirects, etc.

This has a history of regressing with infrastructure (repo toolset, arcade, etc.,) because the infrastructure is opinionated that the build number should not be part of the assembly version, which makes sense for most things, but not build tasks. We need to add test coverage to stop this from regressing. It can go a long time unreported because 1) things might still work when mixing tasks and targets between builds and 2) msbuild nodes eventually shut down and things start working again, letting the problem get chalked up to flakiness that can't be reproduced.

Now, with the move to build-to-build upgrades of patches, dotnet/installer#530, I think there will be a prompt to terminate users of older build or a prompt to reboot following the upgrade.That would mitigate this, but we should still be defensive for forced SxS patch installs (via .zip or whatever).

@nguerrera nguerrera modified the milestones: 2.1.6xx, 2.1.5xx Feb 16, 2019
@nguerrera
Copy link
Contributor Author

Setting milestone optimistically to 2.1.5xx as I think that's the baseline of builds still being patched that have this problem. But we can discuss the bar and where we'd actually like to take the fix. We have to be careful as different infrastructure in different branches may require different fixes.

@nguerrera
Copy link
Contributor Author

The chances of these errors vs. silently using older tasks are much higher in preview-to-preview build-to-build upgrades. Once we are servicing, we don't tend to make many changes to the task dll, and probably never make breaking changes to it.

@nguerrera nguerrera added the Bug label Feb 16, 2019
@johnbeisner
Copy link
Contributor

The 'FilesInUse' functionality of the SDK bundle installer seems to work as it should:

    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.Foundation">
      <bal:WixStandardBootstrapperApplication
        LicenseFile="dummyeula.rtf"
        ShowFilesInUse="yes"
        ShowVersion="yes" />

Example:
filesinusedialog

@nguerrera
Copy link
Contributor Author

I'll fix this now.

@nguerrera nguerrera modified the milestones: 2.1.5xx, 3.0.1xx Jun 13, 2019
wli3 pushed a commit that referenced this issue Feb 7, 2020
….1 (#2953)

- Microsoft.DotNet.Cli.Runtime - 5.0.100-alpha1.19473.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants