Last post Aug 25, 2016 02:14 PM by maherjendoubi
Aug 25, 2016 01:50 PM|lilpug|LINK
is there a way to get IHostingEnvironment in a static class? you cannot dependency inject into a static class or even in an extension method. so i want to know how to obtain the correct application base path within this situation.
i cannot use PlatformServices.Default.Application.ApplicationBasePath as this does not return the basePath for the application in order for me to map some of the views etc, it returns the runtime bin folder.
originally in RC1 you could use: CallContextServiceLocator.Locator.ServiceProvider.GetRequiredService to obtain the service you required, but i do not know how i do this in 1.0
Aug 25, 2016 02:14 PM|maherjendoubi|LINK