Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mark Johnston 59 posts 111 karma points
    Dec 29, 2012 @ 08:09
    Mark Johnston
    0

    Having a crack at building a package, but need some help

    Hi, I am trying to create a package that introduces a feature/system that the developers use at work on a standard ASP.NET MVC app.

    The sorftware is called SquishIt, an overview can be found  here at http://www.codethinked.com/squishit-the-friendly-aspnet-javascript-and-css-squisher and the project can be found here at https://github.com/jetheredge/SquishIt

    I have created a blank ASP.NET project and have used NuGet to get all the libraries that I require:

    • <package id="AjaxMin" version="4.78.4724.23869" targetFramework="net45" />
    • <package id="dotless" version="1.3.1.0" targetFramework="net45" />
    • <package id="EcmaScript.Net" version="1.0.1.0" targetFramework="net45" />
    • <package id="Iesi.Collections" version="3.2.0.4000" targetFramework="net45" />
    • <package id="Microsoft.AspNet.Mvc" version="3.0.20105.1" targetFramework="net45" />
    • <package id="Microsoft.AspNet.Razor" version="1.0.20105.408" targetFramework="net45" />
    • <package id="Microsoft.AspNet.WebPages" version="1.0.20105.408" targetFramework="net45" />
    • <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
    • <package id="MSBuild.Umbraco.Tasks" version="1.0" targetFramework="net45" />
    • <package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
    • <package id="SquishIt" version="0.9.1" targetFramework="net45" />
    • <package id="SquishIt.Less" version="0.9.1" targetFramework="net45" />
    • <package id="UmbracoCms.Core" version="4.11.1" targetFramework="net45" />
    • <package id="WebActivator" version="1.5.3" targetFramework="net45" />
    • <package id="YUICompressor.NET" version="2.2.0.0" targetFramework="net45" />

    Some of these were installed due to dependencies and I have done an upadate to all packages, which leads me to my first issue of some of these DLL's being compiled against particular versions. NuGet solves this by adding some entries to the web.config in the <runtime> section as follows:

      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="dotless.Core" publicKeyToken="96b446c9e63eae34" culture="neutral"/>
            <bindingRedirect oldVersion="0.0.0.0-1.3.1.0" newVersion="1.3.1.0"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="AjaxMin" publicKeyToken="21ef50ce11b5d80f" culture="neutral"/>
            <bindingRedirect oldVersion="0.0.0.0-4.78.4724.23863" newVersion="4.78.4724.23863"/>
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral"/>
            <bindingRedirect oldVersion="0.0.0.0-0.86.0.518" newVersion="0.86.0.518"/>
          </dependentAssembly>
        </assemblyBinding>
      </runtime>

    Unfortunately I can see no way or understand how I can insert these using the package actions and I have also referenced the PackageActionsContrib.dll. After installing my package for testing there is DLL conflicts with dotless which I can clear up by just inserting the previous codeblock into the web.config. It would be good if these assembly redirect entries could be done as part of the package install.

    The Second issue I have is what I have no runtime errors come up the code I am using is not outputting.

    I have added the following to the top on my template Masterpage

    @using SquishIt.Framework

    Then further down where appropriate in the <head> I have added the following 

    @{ Bundle.Css()
       .Add("/less/test.less")
       .Render("/css/uSquishIt.css");
    }

    I have uLess installed which is what I used to create the test.less file but I am thinking it is because I have to somehow integrate the file that SquishIt (SquishItLess.cs) contains in the App_Start folder into the pipeline.The code in the SquishItLess.cs file is the following

    [assembly: WebActivator.PreApplicationStartMethod(typeof(uSquishIt.Core.App_Start.SquishItLess), "Start")]
    namespace uSquishIt.Core.App_Start
    {
        using SquishIt.Framework;
        using SquishIt.Less;
        public class SquishItLess
        {
            public static void Start()
            {
                Bundle.RegisterStylePreprocessor(new LessPreprocessor());
            }
        }
    }

    If anybody wants to see what I have so far I can put the solution up somewhere or feel free to ask me any questions. I realy like the way that SquishIt works so I would like to ba bale to create a package for the community as I am sure others will like the control of it also.

  • Mark Johnston 59 posts 111 karma points
    Jan 05, 2013 @ 01:16
    Mark Johnston
    0

    OK I have done some rework on this and have integrated the uLess project into mine, I can get everything installed but am now having problems getting the SquishIt component to work and am not sure how to track down the issue. Information can be found about how to integrate SquishIt here. I have zipped up my project and it can be downloaded from here. Any pointers as to what I can do to get this working would be helpful.

    Mark

  • Mark Johnston 59 posts 111 karma points
    Jan 05, 2013 @ 08:04
    Mark Johnston
    100

    Ok Seems there was a problem with my Razor markup which I have now recified. I'll create a new issue for my next issue.

Please Sign in or register to post replies

Write your reply to:

Draft