I'm trying to move an app from .net to net core 5, and I'm trying to get the content root.
All of the instructions that I see show using IHostingEnvironment in a controller:
However, using this just get's me "c:" and I suspect that it's because I'm trying to use it, not within a Controller, but within the Identity RegisterModel : PageModel in order to grab an html file that will be a source for the confirmation email.
Could that be the problem?
If so, how would I get the path of a file in code that is not in a controller?