问题描述:

Here's how my folder is set up in Visual Studio 2010:

[solution]/Public

/assets

/stylesheets

bootstrap.css

forms.less

main.less

tigo.less

I've set up some references because I want Bootstrap to appear first and forms and tigo have to appear after main.less.

When I run this application on my local machine, this is the reference:

<link href="/cassette.axd/asset/Public/assets/stylesheets/bootstrap.css?Fr-zb2zZgNbHEFtP2LHSlWzPcTc=" type="text/css" rel="stylesheet"/>

<link href="/cassette.axd/asset/Public/assets/stylesheets/main.less?3YJKuT131pux5i9cKZkQeAO_qLQ=" type="text/css" rel="stylesheet"/>

<link href="/cassette.axd/asset/Public/assets/stylesheets/forms.less?3j_M5YCMRn_e3APdf8XOLJrN9s0=" type="text/css" rel="stylesheet"/>

<link href="/cassette.axd/asset/Public/assets/stylesheets/tigo.less?L6L9pztQ4BxBKmO_Q3XHBJx9L8Q=" type="text/css" rel="stylesheet"/>

It works fine on my machine.

However when publishing to AppHarbor, the references (minified) CSS file only contains the information from bootstrap.css

Here is my configuration for Cassette:

namespace Foo.WebUI

{

/// <summary>

/// Configures the Cassette asset bundles for the web application.

/// </summary>

public class CassetteBundleConfiguration : IConfiguration<BundleCollection>

{

public void Configure(BundleCollection bundles)

{

bundles.Add<StylesheetBundle>("Public/assets/stylesheets");

bundles.Add<ScriptBundle>("Public/assets/javascripts");

}

}

}

And here is my _Layout.cshtml file:

@{

Bundles.Reference("Public/assets/stylesheets");

Bundles.Reference("Public/assets/javascripts");

}

<!DOCTYPE html>

<html>

<head>

<title>@ViewBag.Title</title>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>

<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script>

<link rel="Stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/themes/blitzer/jquery-ui.css" />

@Bundles.RenderStylesheets()

</head>

Any ideas why it's not working correctly? Why is it grabbing bootstrap.css but forgetting about the other three files.

网友答案:

Seems like a similar issue discussed on their support forums:

http://support.appharbor.com/discussions/problems/3876-appharbor-does-not-serve-my-less-files

Summary, the less build files aren't setup in the project properly, set the properties of each less file to set the Build Action to Content and then set the Copy To Output DIrectory value to Copy always.

相关阅读:
Top