2

Is it possible to include a whole directory rather than just a path in Bundle.config? Its much easier than explicitly stating each file.

I've typed in directory as an attribute for the include tag but auto-suggest isn't suggesting anything which makes me think its not possible?

For example;

<?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>
CodeCaster
  • 147,647
  • 23
  • 218
  • 272
sazr
  • 24,984
  • 66
  • 194
  • 362

1 Answers1

0

As explained here, there's an XSD that determines what can go in the Bundle.config file.

The include element is defined as such:

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

So the only allowed format is <include path="~/Content/bootstrap/bootstrap.css" />, where path is expected to point at a single file (see ReadBundle() in BundleManifest.cs).

Community
  • 1
  • 1
CodeCaster
  • 147,647
  • 23
  • 218
  • 272