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

Fix ALC in ProjectReference scenarios #56662

Merged
merged 3 commits into from
Sep 27, 2021
Merged

Conversation

RikkiGibson
Copy link
Contributor

@jaredpar
Copy link
Member

@chsienki, @cston PTAL

writeMethod.Invoke(b, new object[] { sb, "Test G" });

var actual = sb.ToString();
Assert.Equal(@"Delta: Gamma: Test G
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delta

How do we know which version of "Delta" was loaded? Was this the version from deltaFile.Path or from _textFixture.Delta1.Path (which seems like it might be the same path as _textFixture.Gamma.Path)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're asking which copy of Delta version 1, right? I think we can check what file paths the assemblies were loaded from using the TestAccessor, but I'd have to check.

("Delta", "1.0.0.0", delta1File.Path),
("Epsilon", "0.0.0.0", epsilonFile.Path)
}, alcs[0].Assemblies.Select(a => (a.GetName().Name!, a.GetName().Version!.ToString(), a.Location)).Order());
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider extracting a helper method: VerifyLoadContexts(new[] { ("Delta", ..., ...), ("Epsilon", ..., ...) });

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@RikkiGibson RikkiGibson enabled auto-merge (squash) September 27, 2021 21:13
@RikkiGibson RikkiGibson merged commit 9ec2b39 into dotnet:main Sep 27, 2021
@ghost ghost added this to the Next milestone Sep 27, 2021
@Cosifne Cosifne modified the milestones: Next, 17.0.P5 Sep 27, 2021
@RikkiGibson RikkiGibson deleted the alc-fix branch September 28, 2021 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RC1 regression: dependencies no longer work correctly in source generators across <ProjectReference>
5 participants