2015-07-12 133 views
2

是否可以在Bundle.config中包含整個目錄而不僅僅是一個路徑?它比明確說明每個文件要容易得多。在Bundle.config中包含目錄

我已經輸入directory作爲include標記的屬性,但自動建議並不是暗示任何讓我覺得它不可能的事情?

例如;

<?xml version="1.0" encoding="utf-8" ?> 
<bundles version="1.0"> 
    <styleBundle path="~/Content/css"> 
    <include path="~/Content/bootstrap/bootstrap.css" /> 
    <include directory="~/Content/SomeDirectory" /> 
    </styleBundle> 
</bundles> 

回答

0

由於explained here,還有它決定了可以在Bundle.config文件去的XSD。

include元素被定義爲這樣:

<xs:complexType name="include"> 
    <xs:attribute name="path" type="xs:string" use="required" /> 
</xs:complexType> 

所以只允許格式是<include path="~/Content/bootstrap/bootstrap.css" />,其中path預計在單個文件(see ReadBundle() in BundleManifest.cs)到點。

+0

如果我的答案的downvoter可以解釋我爲什麼他們downvoted,我會很高興。 – CodeCaster