Confused file path notations on multiproject solution

Marios Charalambous 40 Reputation points
2023-03-08T10:59:29.24+00:00

In my IndexJson.cshtml i have a script notation with src tag:

<script src="~/js/site.js"></script>

But it reads from my Main's project site.js noted with number 2 on my image , instead of reading from site.js number 1.

User's image

Developer technologies | ASP.NET | ASP.NET Core
Developer technologies | C#
{count} votes

Accepted answer
  1. AgaveJoe 30,126 Reputation points
    2023-03-08T12:08:01.74+00:00

    The Main project is in bold which means it is the startup project. Therefore, site.js 2 is the JavaScript file that is returned by the static file handler. The project/solution is functioning as expected.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.