开发者

Structuremap does not load registries when started from Network drive

I am an enthousiastic (new) user of structuremap but I am experiencing a problem loading registries.

When I start my application from a local drive all the registries in my application are used to resolve types. I verified this by ObjectFactory.WhatDoIHave() However when I start the same application from a share then not all registries are loaded. It seems only the registries that are currently loaded in the appdomain are used to register types. The weird thing is that the application did work. Recently I upgraded my application from .Net 3.5 to 4.0, maybe this has something to do with it.

This is what I found until now, could this be the problem? Assembly.LoadFrom() permissioning in .NET 4.0

my code to register my registrie开发者_C百科s is:

var _container = new Container(x =>
            {
                x.Scan(
                    scan =>
                    {
                        scan.AssembliesFromApplicationBaseDirectory();
                        scan.LookForRegistries();
                    });
            });


I was able to solve this problem myself. 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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜