Open DrewBrasher opened 5 months ago
I think this issue is because Razor Pages file names do not match the class names. So this method:
https://github.com/Lombiq/Lombiq-Orchard-Visual-Studio-Extension/blob/2a82482674025f884de179247dde0d5d579f1c5b/Lombiq.Vsix.Orchard/Services/DependencyInjector/DependencyInjector.cs#L90-L96
for a file called Index.cshtml.cs
would return Index.cshtml
but the actual class name is IndexModel
.
I created pull request https://github.com/Lombiq/Lombiq-Orchard-Visual-Studio-Extension/pull/40 to add support for this.
If I try to use the Dependency Injector in the
.cshtml.cs
file of a Razor Page, it gets the error: "Could not inject dependency because the class was not found in his file"Jira issue