anaisbetts / SassAndCoffee

SassAndCoffee adds support in ASP.NET MVC to (you guessed it!) Sass/SCSS and CoffeeScript
http://blog.paulbetts.org/index.php/2011/06/06/new-release-sassandcoffee-0-9-now-not-glacially-slow/
Microsoft Public License
199 stars 37 forks source link

Throwing 404.x errors #57

Open thany opened 12 years ago

thany commented 12 years ago

I installed this package into an existing project. The project happns to be a Sitecore project, but I don't think that should matter.

The documentation says nothing about any further steps, so all you're supposed to need to do is create a SCSS file and request it as if it were a CSS file. I did that.

I created a test.scss file right next to an existing style.css file. The style.css file is requestable just like it's always been. The newly-created test.scss is not requestable at all:

test.css returns: HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

test.scss returns: HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

Again, I just installed SassAndCoffee fresh. I've never had it anywhere before. I did nothing after install, beside creating a scss-file.

kogir commented 12 years ago

Sorry things aren't working for you.

May I ask what version of IIS you are using? If you're using IIS 6 you'll need to add script maps for .js and .css files, or if it's acceptable in your environment, a wildcard script map.

If you're using IIS 6 and would like more detailed help, please let me know which version of ASP.net you're using (2 or 4, x86 or x64).

thany commented 12 years ago

It seems I'm using IIS 7.5 on Windows 7 x64 SP1. This website will eventually be transferred to Win2008 servers. No idea what version runs on them.

This particular project is compiled for .NET 4.0, but we also have some ongoing projects that are 2.0.

kogir commented 12 years ago

The nuget package should add all the configuration you need for things to work out of the box in IIS 7+. Do you see any of the following in your web.config?

<system.web>
        <caching>
            <outputCacheSettings>
                <outputCacheProfiles>
                    <add name="SassAndCoffeeCacheSettings"
                         enabled="true"
                         duration="3600"
                         location="Any"
                         varyByHeader="Accept-Encoding" />
                </outputCacheProfiles>
            </outputCacheSettings>
        </caching>
        <httpModules>
            <add name="SassInterceptorModule"
                 type="SassAndCoffee.AspNet.SassInterceptorModule" />
            <add name="JavaScriptInterceptorModule"
                 type="SassAndCoffee.AspNet.JavaScriptInterceptorModule" />
        </httpModules>
    </system.web>
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules runAllManagedModulesForAllRequests="true" >
            <add name="SassInterceptorModule"
                 type="SassAndCoffee.AspNet.SassInterceptorModule" />
            <add name="JavaScriptInterceptorModule"
                 type="SassAndCoffee.AspNet.JavaScriptInterceptorModule" />
        </modules>
        <caching enabled="true"
                 enableKernelCache="true">
            <profiles>
                <add extension=".css"
                     policy="CacheUntilChange"
                     kernelCachePolicy="CacheUntilChange"
                     varyByHeaders="Accept-Encoding"
                     location="Any"/>
                <add extension=".js"
                     policy="CacheUntilChange"
                     kernelCachePolicy="CacheUntilChange"
                     varyByHeaders="Accept-Encoding"
                     location="Any"/>
            </profiles>
        </caching>
        <urlCompression doStaticCompression="true"
                        doDynamicCompression="true" />
    </system.webServer>
WouterBos commented 12 years ago

Ah! This was the information I missed. This info should be in the README.md.

Thanks!

For your information: I installed SassAndCoffee the regular way (nuget).

JPeetje commented 12 years ago

I get the same error,

HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

I'm working with a newly created ASP.NET MVC3 project to which I added SassAndCoffee. I then renamed Site.css to Site.scss and tried to simply use one variable to verify it all works. So far, it does not ;-). Checked the web.config, it has all the configuration you posted above. Any further ideas?

ialekseev commented 11 years ago

Hello!

I have the same error with valid configuration in Web.config. Can somebody help me, please?