【发布时间】:2015-05-02 19:58:50
【问题描述】:
我有一个使用 VS2015 使用新预览版C# 6 创建的 MVC Web API 应用程序。
该项目默认带有一个Dependencies 文件夹和一个wwwroot 文件夹。这两个都位于我项目的根目录中。
在wwwroot 中,我有一个index.html,它试图引用angular.js,它可以在Dependencies/Bower 文件夹中找到(实际路径名为$(project_rootDir)/bower_components/。
所以在我的index.html 中我只是这样做:
<script src="../bower_components/angular/angular.js"></script>
当我启动 IIS Express 并检查 index.html 试图通过控制台加载的文件时,我看到它试图从中获取它:
localhost:5000/bower_components/angular/angular.js
但路径应该是:
localhost:5000/../bower_components/angular/angular.js
但它似乎无法从 wwwroot 文件夹之外引用 JS 文件。所以我有点卡住了。我能做些什么?我想从wwwroot文件夹中引用Dependencies文件夹中的JS文件。
【问题讨论】:
标签: c# asp.net-core visual-studio-2015