我有一個使用新預覽C# 6
使用VS2015創建的MVC Web API應用程序。來自wwwroot的VS2015參考依賴關係
該項目默認帶有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文件。
似乎複製文件是當前唯一的選擇。 – Vivendi