-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
OOB Library's AssemblyVersion is inconsistent between ref and src assemblies in servicing #63467
Comments
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries Issue DetailsWhen servicing a library that targets .NET Framework, we are bumping up the AssemblyVersion on the .NET Framework assemblies: Lines 42 to 44 in 634dfa1
However, this is only applying to the I hit this problem because we have a test which was failing trying to load a serviced assembly:
The reason this happened is because the This can also cause issues when a serviced library has a ProjectToProject reference to another serviced library. In talking with @ericstj, we think the correct thing to do here is to ensure both the
|
@ericstj do you know if anyone started working on this? Based on Lines 32 to 46 in e386044
Alternatively we could fix this by removing the out-of-band reference projects as they aren't shipping anymore anyways since NET6 which would have the added benefit of making the build graph smaller which has a positive impact on build times, solution file size, maintenance costs of the ref, etc. |
When servicing a library that targets .NET Framework, we are bumping up the AssemblyVersion on the .NET Framework assemblies:
runtime/eng/packaging.targets
Lines 42 to 44 in 634dfa1
However, this is only applying to the
src
project, because this logic is contained inpackaging.targets
which is only imported for thesrc
project. For theref
project the AssemblyVersion is staying6.0.0.0
, since this logic doesn't run and because theServicingVersion
is only defined in thesrc
project.I hit this problem because we have a test which was failing trying to load a serviced assembly:
The reason this happened is because the
ref
assembly forMicrosoft.Extensions.Hosting
was being passed to the test, so the test was getting a reference toVersion=6.0.0.0
. But thesrc
assembly is used at runtime, which is version6.0.0.1
. No assembly binding redirect is getting generated for this reference because the test is the "top" of the dependency chain and no one else is referencing a lower version ofMicrosoft.Extensions.Hosting
. So no redirect is getting generated.This can also cause issues when a serviced library has a ProjectToProject reference to another serviced library.
Microsoft.Extensions.Hosting
referencesMicrosoft.Extensions.Configuration.UserSecrets
. TheHosting
package version of6.0.1
will reference theUserSecrets
package version6.0.1
.UserSecrets v6.0.1
will contain the6.0.0.1
netfx assembly. HoweverHosting v6.0.1
's netfx assembly will have a binary reference to6.0.0.0
because that's what theref
assembly forUserSecrets
is during our build.In talking with @ericstj, we think the correct thing to do here is to ensure both the
ref
andsrc
assemblies get the same AssemblyVersion during servicing.@safern
The text was updated successfully, but these errors were encountered: