The 2.1.8 shared framework contains some assemblies older than the 2.1.7 framework. This is a result of incorrect data in the baseline file. For instance:
https://github.com/aspnet/AspNetCore/blob/4cceccd5689ebf7712c03789df536cbb4cfc2efc/eng/Baseline.xml#L123
The actual latest stable release of Microsoft.AspNetCore is 2.1.7. This can cause runtime exceptions such as https://github.com/aspnet/AspNetCore/issues/3503#issuecomment-463134356 if users target 2.1.7 but rollforward to newer shared frameworks.
cc @dougbu @mikaelm12 @Eilon
Oops. Are there any good workarounds to this? Add explicit reference to the correct version? (Downgrading to older patch is not a "good" workaround.)
There are several workarounds.
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.7" /> (NB: this is NOT the .App package)<PackageReference Include="Microsoft.AspNetCore" /><PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.8" />To help us catch this in the future, I think we should consider adding a unit test which reads this baseline and checks that it matches the latest 2.1.* on nuget.org. The SDK team did this for a similar kind of baseline file problem.
This looks like a patch candidate for sure.
@dougbu Would you be the right person to fix this? Could you prepare a PR and ping me on it, so that we can bring this to shiproom tomorrow? This can be a tactical PR just to fix the issue, but we definitely need to add the test @natemcmaster specifies above to prevent this from happening again.
I'd appreciate it if @mikaelm12 could take a look at this first. @mikaelm12 is that :ok: with you?
But, I'll double-check the current 2.1.9 branding.
Yeah, I can do it.
Problem remains in current release/2.1 branch. I'll fix that up and leave the test to @mikaelm12
See aspnet/AspNetCore#7556
Is the following related to this issue?
https://github.com/dotnet/core/issues/2304#issuecomment-463154664
cc @joeloff
@muratg probably related
@muratg Yes, that's the exact same error.
I've manually checked the Baseline.xml file against the current NuGet versions of each package. Nothing other than Microsoft.AspNetCore was behind.
Rather than do 2.2.3 manually, I'll turn to the test…
One alternative: Change the Baseline.xml file to list only Major.Minor versions and have BaselineGenerator determine the latest patch version.
@natemcmaster I don't see anything but BaselineGenerator that reads Baseline.xml. Am I missing anything?
Other thoughts on this infrastructure reformat versus a separate test?
I don't think we should only list Major.Minor. This could lead to non-deterministic behavior when re-generating baselines.
@mikaelm12 was looking into adding test coverage for this. I added @dougbu to the email thread in which we're brainstorming fixes.
FYI: App Services in Azure also updated to the latest DotNet Core SDK, so this bug could effect your apps published to there.
Today I just had to fix one of our Asp.Net applications.
In the eventlog.xml I saw the following error entry:
Application: dotnet.exe CoreCLR Version: 4.6.27317.3 Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore, Version=2.1.7.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
@dougbu and @mikaelm12 in addition to the automation, could you guys please review the file (for both 2.2 and 2.1) to make sure it's correct on both branches?
Two more sets of eyes would be good on this.
I'll sync up with @dougbu on this today
Though my comment above said I only did the release/2.1 branch. I checked the versions manually in both branches.
The new test should confirm what I saw.
I've also just manually checked the versions in both the 2.1 and 2.2 branches. The shouldn't be any version downgrade issues
Thanks guys!