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

Additional Files with an empty target path will crash the source generator #7236

Closed
chsienki opened this issue Apr 21, 2022 · 0 comments · Fixed by #7997
Closed

Additional Files with an empty target path will crash the source generator #7236

chsienki opened this issue Apr 21, 2022 · 0 comments · Fixed by #7997
Assignees
Labels
area-compiler Umbrella for all compiler issues bug Something isn't working
Milestone

Comments

@chsienki
Copy link
Contributor

The razor source generator requires every .cshtml or .razor file to have an associated TargetPath metadata item. We report a diagnostic to say that a given item didn't have a target path (https://github.com/dotnet/sdk/blob/4ac98544c9b8e1a1e433675b9bd3290c0d0578d5/src/RazorSdk/SourceGenerators/RazorSourceGenerator.RazorProviders.cs#L73) but try and continue when it is empty.

We should warn and stop processing when the target path is either null or empty.


The actual crash happens because

@chsienki chsienki added the area-compiler Umbrella for all compiler issues label Apr 21, 2022
@chsienki chsienki self-assigned this Apr 21, 2022
@jaredpar jaredpar assigned RikkiGibson and unassigned chsienki Apr 21, 2022
@jaredpar jaredpar added untriaged bug Something isn't working and removed untriaged labels May 5, 2022
@chsienki chsienki transferred this issue from dotnet/razor-compiler Oct 28, 2022
@ghost ghost added the untriaged label Oct 28, 2022
@jaredpar jaredpar assigned jjonescz and unassigned RikkiGibson Nov 29, 2022
@ghost ghost added the untriaged label Nov 29, 2022
@jaredpar jaredpar added this to the 17.5 milestone Nov 29, 2022
@ghost ghost removed the untriaged label Nov 29, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jan 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-compiler Umbrella for all compiler issues bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants