I have a project that requires retrieving files from outside itself on the server its hosted on. For now, I'm just grabbing a Javascript file but it will eventually grab other things. I tried out changing the content root path in Program.cs to allow this and it worked beautifully. But I noticed that the original relative links to Javascript and css files still worked without any changes.
For example this path, "~/css/site.css", still works despite changing the content root path and not telling it to specifically look in my project's own wwwroot folder. The external file must use a more specific path. For example: "~/some-other-project/wwwroot/js/myscripts.js".
Now this is all fine and actually preferred behavior but I want to know why it's working this way. Does the project check its own wwwroot folder first before looking elsewhere in the folder specified in the content root path? I want to understand the behavior behind this so I can feel more confident in using this method.
EDIT: Here is a repo with as an example: https://github.com/love-bird-13/Custom-Content-Path-Test The first commit is just setting up two basic .Net 6 projects without any changes. The second commit contains all the changes I made to reproduce what I'm talking about.