Skip to content

Fix ALC in ProjectReference scenarios#56662

Merged
RikkiGibson merged 3 commits intodotnet:mainfrom
RikkiGibson:alc-fix
Sep 27, 2021
Merged

Fix ALC in ProjectReference scenarios#56662
RikkiGibson merged 3 commits intodotnet:mainfrom
RikkiGibson:alc-fix

Conversation

@RikkiGibson
Copy link
Copy Markdown
Member

@RikkiGibson RikkiGibson requested a review from a team as a code owner September 23, 2021 22:23
@ghost ghost added the Area-Compilers label Sep 23, 2021
@jaredpar
Copy link
Copy Markdown
Member

@chsienki, @cston PTAL

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

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

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
Copy Markdown
Member 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
Copy Markdown
Contributor

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
Copy Markdown
Member 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