U4-1601 - 4.11.3.1 - Application_Start treats all assemblies in bin folder as plugins

Created by Oliver Wittet 30 Jan 2013, 03:42:58 Updated by Shannon Deminick 26 Feb 2013, 14:30:01

Duplicates: U4-1187

We have a an application built on Umbraco 4.0.x and we are in the process of upgrading. We jumped from 4.6.1 to 4.11.3.1 and started getting "Could not load file or assembly 'nunit.core.interfaces..." exception.

I've tracked it down the Application_Start in Umbraco.Web.UmbracoApplication which is trying to scan all assemblies in the bin folder and load all referenced assemblies. The problem comes that we are using debug assemblies from our other libraries which have references to unit testing libraries (in this case nunit) which are NOT copied over to the bin.

We would like to be able to run the site with all our libraries in debug mode without having to load the testing dll's too.

I noticed in Umbraco.Core.TypeFinder that there is a KnownAssemblyExclusionFilter array which looks like it could live in a config file somewhere.

That or maybe don't do this "scan" in the first place - I noticed that umbraco.BusinessLogic.Actions.Action.ReRegisterActionsAndHandlers() has comments to the effect that maybe this didn't need to be run at all.

1 Attachments

Download stacktrace.txt

Comments

Shannon Deminick 30 Jan 2013, 13:19:11

This is a duplicate of bug: U4-1187

The problem is that there is no real good way to solve this issue (please see notes of the other bug). That said, I think the only 'good' way is to be able to modify the KnownAssemblyExclusionFilter on app pre-init or something, at least that way people who genuinely want avoid these exceptions can.


Oliver Wittet 01 Feb 2013, 08:20:48

Sounds like a good solution to me. Just out of interest why does it need to "scan" all the assemblies in the first place?


Oliver Wittet 26 Feb 2013, 00:33:52

Would it not be possible to just disable this feature altogether? We are having to perform some bad hacks in order to get around this problem...


Shannon Deminick 26 Feb 2013, 14:29:02

Because there are a ton umbraco plugin based types that need to be loaded for Umbraco to work. Plugin types are simply found and loaded, they do not need to be explicitly registered. Things like SurfaceControllers, DataTypes, cache refreshers... the list goes on. We cannot disable plugins otherwise nothing in Umbraco will work. The easiest fix for this is to ensure you have the correct assemblies in your bin folder.


Shannon Deminick 26 Feb 2013, 14:30:01

for whatever reason it looks like you are referencing code in nunit so you'd need that assembly in your bin folder


Priority: Major

Type: Bug

State: Duplicate

Assignee: Shannon Deminick

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version:

Sprint:

Story Points:

Cycle: