We have moved to GitHub Issues
Created by Oliver Wittet 30 Jan 2013, 03:42:58 Updated by Shannon Deminick 26 Feb 2013, 14:30:01
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 22.214.171.124 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.
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.
Sounds like a good solution to me. Just out of interest why does it need to "scan" all the assemblies in the first place?
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...
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.
for whatever reason it looks like you are referencing code in nunit so you'd need that assembly in your bin folder
Assignee: Shannon Deminick
Backwards Compatible: True
Due in version: