title: Cannot access JavaScript files inside View folder in ASP.NET MVC
body: <p>I am trying to add AngularJS in my mvc project.</p>
  
  <p>This is my bundle config</p>
  
  <pre class="lang-js prettyprint-override"><code>  public static void RegisterBundles(BundleCollection bundles) {
  
             bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                      "~/Scripts/jquery-{version}.js"));
  
              bundles.Add(new ScriptBundle("~/bundles/angularjs").Include(
                         "~/Scripts/angular.js",
                          "~/Scripts/angular-ui-router.js"));
  
                 bundles.Add(new ScriptBundle("~/bundles/appscripts").Include(
                     "~/Areas/app.module.js",
                     "~/Areas/app.component.js",
                     "~/Areas/app.routes.js",
  
       bundles.Add(new ScriptBundle("~/bundles/appcomponents").Include(
        "~/Areas/Home/Views/Default/default.component.js"));
          }
  </code></pre>
  
  <p>_Layout.cshtml</p>
  
  <pre class="lang-js prettyprint-override"><code>    @Scripts.Render("~/bundles/jquery")
      @Scripts.Render("~/bundles/angularjs")
      @Scripts.Render("~/bundles/appscripts")
      @Scripts.Render("~/bundles/appcomponents")
      @RenderSection("scripts", required: false)
  </code></pre>
  
  <p>I am able to add <code>~/bundles/jquery</code>, <code>~/bundles/angularjs</code> and <code>~/bundles/appscripts</code></p>
  
  <p><a href="https://i.stack.imgur.com/GVtgq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GVtgq.png" alt="enter image description here"></a></p>
  
  <p>but I am unable to add <code>~/bundles/appcomponents</code> and I am getting a 404 error for this script.</p>
  
  <p><a href="https://i.stack.imgur.com/vF6hZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vF6hZ.png" alt="enter image description here"></a></p>
  
  <p>I also tried adding the script file directly in the _layout.cshtml</p>
  
  <pre class="lang-js prettyprint-override"><code>&lt;script src="~/Areas/Home/Views/Default/default.component.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>and I am getting the same error.</p>
  
  <p>I am not sure why I am not able to add any scripts from the Views folder.</p>
  
  <p>Can anyone please let me know how I can add this script file in the bundle config?</p>