Structuremap does not load registries when starting from a network drive

I am an enthusiastic (new) user of the structure structure, but I am having problems loading registries.

When I run my application from a local drive, all the registries in my application are used for type resolution. I checked this with ObjectFactory.WhatDoIHave () However, when I run the same application from a shared resource, not all registries are loaded. It seems that only registers that are currently loaded in appdomain are used to register types. It is strange that the application really works. I recently upgraded my application from .Net 3.5 to 4.0, maybe this has something to do with it.

This is what I have found so far, could this be a problem? Assembly.LoadFrom () in .NET 4.0

My code for registering my registries is:

var _container = new Container(x => { x.Scan( scan => { scan.AssembliesFromApplicationBaseDirectory(); scan.LookForRegistries(); }); }); 
+3
source share
1 answer

I myself was able to solve this problem. The problem is explained here: http://msdn.microsoft.com/en-us/magazine/ee677170.aspx I added the following to my .config file, and then it worked like a charm:

 <configuration> <runtime> <!-- WARNING: will load assemblies from remote locations as fully trusted! --> <loadFromRemoteSources enabled="true" /> </runtime> </configuration> 
+3
source

Source: https://habr.com/ru/post/1308767/


All Articles