This project is read-only.

Configuration

In order to take advantage of new features requires manual editing of Web.config.

First, you need to declare a new configuration section luckyAssetManagerContrib:

<configuration>
  <configSections>
    ...
    <section name="luckyAssetManagerContrib" 
      type="LuckyAssetManagerContrib.Configuration.AssetManagerContribSettings" 
      allowDefinition="Everywhere" allowLocation="true"/>
  </configSections>
  ...
</configuration>
 

Second, add it (configuration section):

<configuration>
  ...
  <luckyAssetManagerContrib>
    <selectPathProcessor 
      memoryCacheDurationInMinutes="15"
      useMemoryCacheSlidingExpiration="false" />
    <finalProcessor disableCombiningAssetsInDebugMode="true" />
    <assetFileCacheManager 
      fileCacheDurationInMinutes="30"
      fileCacheRegistrySaveIntervalInMinutes="1"
      useFileCacheSlidingExpiration="true" />
    <assetsHandler
      clientCacheDurationInDays="15"
      enableCompression="true"
      useLastModifiedHeader="true"
      useETagHeader="true" />
  </luckyAssetManagerContrib>
  ...
</configuration>

Third, you need to remove debug attribute of assetManager element and remove declarations of old asset processors:

<configuration>
  ...
  <lucky>
    <assetManager debug="true"
      cacheFactoryType="Lucky.AssetManager.Configuration.MemoryCacheFactory, Lucky.AssetManager">
      <css>
        <processors>
          <add name="RelativePathing" 
            type="Lucky.AssetManager.Processors.CssRelativePathProcessor, Lucky.AssetManager" />
          <add name="Combine" 
            type="Lucky.AssetManager.Processors.CombineProcessor, Lucky.AssetManager" />
          <add name="Minimize" 
            type="Lucky.AssetManager.Processors.YuiMinimizeProcessor, Lucky.AssetManager" />
        </processors>
      </css>
      <javascript alternateName="cdn">
        <processors>
          <add name="Combine" 
            type="Lucky.AssetManager.Processors.CombineProcessor, Lucky.AssetManager" />
          <add name="Minimize" 
            type="Lucky.AssetManager.Processors.YuiMinimizeProcessor, Lucky.AssetManager" />
        </processors>
      </javascript>
    </assetManager>
  </lucky>
  ...
</configuration>

And instead of them, you need to add new asset processors:

<configuration>
  ...
  <lucky>
    <assetManager
      cacheFactoryType="Lucky.AssetManager.Configuration.MemoryCacheFactory, Lucky.AssetManager">
      <css>
        <processors>
          <add name="SelectPath" 
            type="LuckyAssetManagerContrib.Processors.SelectPathProcessor, LuckyAssetManagerContrib" />
          <add name="Final"
            type="LuckyAssetManagerContrib.Processors.FinalProcessor, LuckyAssetManagerContrib" />
        </processors>
      </css>
      <javascript alternateName="cdn">
        <processors>
          <add name="SelectPath"
            type="LuckyAssetManagerContrib.Processors.SelectPathProcessor, LuckyAssetManagerContrib" />
          <add name="Final"
            type="LuckyAssetManagerContrib.Processors.FinalProcessor, LuckyAssetManagerContrib" />
        </processors>
      </javascript>
    </assetManager>
  </lucky>
  ...
</configuration>

Fourth, you need to replace old HTTP-handlers with new ones. In HTTP-handlers, who have attribute path equal assets.axd, you need to replace attribute type value from Lucky.AssetManager.Web.AssetsHandler to LuckyAssetManagerContrib.Web.AssetsHandler:

<configuration>
  ...
  <system.web>
    ...
    <httpHandlers>
      ...
      <add verb="*" path="assets.axd" 
        type="LuckyAssetManagerContrib.Web.AssetsHandler" />
      ...
    </httpHandlers>
    ...
  </system.web>

  <system.webServer>
    ...
    <handlers>
      ...
      <add name="AssetsHandler" verb="*" path="assets.axd" 
        type="LuckyAssetManagerContrib.Web.AssetsHandler" />
      ...
    </handlers>
    ...
  </system.webServer>
  ...
</configuration>

Enjoy!

Last edited Feb 25, 2012 at 10:47 AM by Taritsyn, version 15