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

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,134 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,197 questions
{count} votes

Accepted answer
  1. AgaveJoe 26,181 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