Open AvremelM opened 9 months ago
This was (I believe) intended to be added as part of https://github.com/dotnet/systemweb-adapters/issues/368, but was omitted for some reason, perhaps unintentionally.
Yup, it was planned to be a part of that, but got left out. I believe the building blocks should be there - would you be able to submit a PR to enable it?
I may be able to if I find time. I'll have to take a closer look at how things are usually done in this repo, I'd rather not submit noncompliant code if I can help it.
@twsouthwick Is there any documentation or discussions in this project about copying over (and adapting) code from @microsoft/referencesource? I.e., Are we allowed to? Is it even worth the effort? Is it a bad idea to even try?
Is there any documentation or discussions in this project about copying over (and adapting) code from @microsoft/referencesource? I.e., Are we allowed to? Is it even worth the effort? Is it a bad idea to even try?
Yup that's how we've done it. microsoft/referencesource was changed to the MIT license a few years back specifically for these kinds of efforts (https://github.com/microsoft/referencesource?tab=readme-ov-file#license). There are still some files that are licensed differently, but as long as you're not using one of those, it's fine
@AvremelM did you want to supply a PR for this?
Last I looked into it I think I wasn't sure how best to go about it while maintaining the original framework's (undocumented) functionalities, esp all the stuff in HostingEnvironment.MapPathActual
.
It's on my eventual list, but I don't have anything ready at the moment, (and in the meantime I was waiting to see what happens with my other PRs to learn more about contributing).
We have a IMapPathUtility that you could start with. I wouldn't say you need all the functionality to start with, just the basic stuff. We could always expose the IMapPathUtility so additional functionality could be overwritten there to light up scenarios you need after the fact.
If you do decide to do that, feel free to add some comments in the code as to what is being excluded from the original implementation for posterity
Summary
Support
HostingEnvironment.MapPath
in SystemWebAdapters.Motivation and goals
HttpServerUtility.MapPath
HttpServerUtility.MapPath
(and all other similar methods, e.g.,HttpRequest.MapPath
andVirtualPath.MapPath
) all actually useHostingEnvironment.MapPath
/HostingEnvironment.MapPathInternal
internally.Examples