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
  • 139,522
  • 20
  • 204
  • 252
sazr
  • 23,396
  • 63
  • 179
  • 330

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
  • 139,522
  • 20
  • 204
  • 252