[release/2.3] Fix Mvc.FunctionalTests referencing RazorPagesClassLibrary #59361
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the Mvc.FunctionalTests test failures involving RazorPagesClassLibrary on my local machine. It appears that while testing in the release/2.3 aspnetcore repo, Microsoft.NET.Sdk.Razor SDK does not bring in all the properties and targets from Microsoft.AspNetCore.Razor.Design and Microsoft.AspNetCore.Mvc.Razor.Extensions, so this PR manually imports them into the RazorPagesClassLibrary test project.
I got inspiration from ClassLibrary test project in the Razor.Design testassets. The main difference is that I manually set the
_RazorTaskAssembly
property to point inside the bin folder instead of letting it be derived solely from the_RazorMSBuildRoot
like the_RazorToolAssembly
.I'm not sure why this difference is necessary, or why these changes are only needed now. That's why I'm opening this PR up as a draft so someone like @javiercn can determine if this makes sense, or if the test failures might be indicative of some build-time regression.