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

Could not load file or assembly WebActivatorEx #327

Open kipusoep opened 8 years ago

kipusoep commented 8 years ago

Installing SquishIt version 0.9.8.1 via NuGet gives the following exception at runtime:

Could not load file or assembly WebActivatorEx, Version=2.0.0.0, Culture=neutral, PublicKeyToken=7b26dc2a43f6a0d4 or one of its dependencies. The system cannot find the file specified.

The dependency WebActivator (≥ 1.4.0) as shown on (this page) isn't there in NuGet's UI and thus not added.

AlexCuse commented 8 years ago

Ugh. The original WebActivator package was de-listed. I will need to test with v2 and make sure everything works, i'll try to get 0.9.8.2 out soon I guess. Kind of frustrating that it won't allow installation once it is de-listed, wonder how many other projects that breaks.

AlexCuse commented 8 years ago

If you install WebActivatorEx v2.0 does it work?

kipusoep commented 8 years ago

Sorry, didn't check that, reverted to previous SquishIt right away.

AlexCuse commented 8 years ago

So there are no hard references to WebActivator anywhere (there will be in v1.0)

Guessing it is probably related to this file that gets transformed by nuget: https://github.com/jetheredge/SquishIt/blob/a00720b09fdd42920aa723944cb2ae1f58507c72/SquishIt.Less/Content/App_Start/SquishItLess.cs.pp

You reverted via git checkout (or similar) right? I would expect the problem to occur regardless of version if you install the preprocessor package after the date WebActivator was delisted.

So if you install/update a preprocessor and experience this problem, I'm guessing the fix will be to install WebActivatorEx on its own. I will update it in future packages once I am done cursing nuget for this.

kipusoep commented 8 years ago

I reverted by installing the previous SquishIt version on NuGet. The reason this exception occurred is because of Umbraco (CMS). The Boot manager of Umbraco registers plug-ins and scans all assemblies in the AppDomain. During this scan any non-resolvable references throw an exception.

AlexCuse commented 8 years ago

Huh, I wouldn't expect the previous version to work either. You are using SquishIt.Less right? It has always referenced WebActivator (not EX).

Anyway you can try this: https://www.nuget.org/packages/SquishIt.Less/0.9.8.2-beta1

kipusoep commented 8 years ago

No I'm talking about the regular SquishIt package. I'm sure it had a dependency to WebActivator :-/

AlexCuse commented 8 years ago

Nah, it shouldn't. v1.0 will, but 0.9.8.1 doesn't have any dependency on WebActivator (hard or soft).

I'll try to look into this some more tomorrow but I don't see where that message would've come from unless you were using a preprocessor.

kipusoep commented 8 years ago

Sorry for the large screenshot and Dutch language ;-)

webactivatorex-exception

Opening the assembly in ILSpy:

webactivatorex-reference

AlexCuse commented 8 years ago

This is weird, looks like a 1.0 assembly got pushed with the old package definition. Thanks for pointing this out - I pulled 0.9.8.1 and am working on resolution now.

AlexCuse commented 8 years ago

Just pushed 0.9.8.2, it should solve the problem. Thanks again for pointing this out!

image