jetheredge / SquishIt

Lets you *easily* bundle some css and javascript! Check out the Google group if you have questions!
http://groups.google.com/group/squishit
MIT License
459 stars 119 forks source link

Update Nuget version breaks #345

Open quintonn opened 6 years ago

quintonn commented 6 years ago

The following code crashes in visual studio 2017 .net 4.6.1: var cssBundle = new SquishIt.Framework.CSS.CSSBundle();

Error: Object reference not set to an instance of an object.

at SquishIt.Framework.CSS.CSSBundle..ctor() in c:\Users\alexu\git\SquishIt\SquishIt.Framework\CSS\CSSBundle.cs:line 64 at BuildHelper.Program.BuildWebsiteTemplate() in D:\Projects\WebsiteTemplate\BuildHelper\Program.cs:line 38 at BuildHelper.Program.Main(String[] args) in D:\Projects\WebsiteTemplate\BuildHelper\Program.cs:line 14

quintonn commented 6 years ago

I replaced that 1 line with the following and it's working now:

Configuration.Instance.Platform = new PlatformConfiguration(); Configuration.Instance.Platform.CacheImplementation = new CacheImplementation(); Configuration.Instance.Platform.DebugStatusReader = new DebugStatusReader(); Configuration.Instance.Platform.TrustLevel = new MyTrustLevel(); Configuration.Instance.Platform.PathTranslator = new PathTranslator();

        var cssBundle = Bundle.Css();// new SquishIt.Framework.CSS.CSSBundle();
AlexCuse commented 6 years ago

I'm not fully understanding your reply but in general you want to use those static methods off of Bundle class as the entry point to working with bundles. Are you trying to use SquishIt.Framework directly (without the asp.net integration) in some kind of build utility?

quintonn commented 6 years ago

Yes, i am writing my own build utility to minify css

AlexCuse commented 6 years ago

Hmm have not thought about this in a long time (there used to be a command line utility included in this project). Have you had much success?