从网络驱动器启动时,Structuremap 不加载注册表

发布于 2024-09-11 06:51:59 字数 744 浏览 0 评论 0原文

我是 Structuremap 的热心(新)用户,但我在加载注册表时遇到问题。

当我从本地驱动器启动应用程序时,应用程序中的所有注册表都用于解析类型。我通过 ObjectFactory.WhatDoIHave() 验证了这一点 但是,当我从共享启动同一应用程序时,并非所有注册表都会加载。 似乎只有当前在应用程序域中加载的注册表用于注册类型。 奇怪的是该应用程序确实有效。最近我将我的应用程序从.Net 3.5升级到4.0,也许这与它有关。

这是我到目前为止发现的,这可能是问题所在吗? .NET 4.0 中的 Assembly.LoadFrom() 权限

我的代码进行注册我的注册表是:

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

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 registries is:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

找个人就嫁了吧 2024-09-18 06:51:59

我自己能够解决这个问题。
该问题的解释如下: http://msdn.microsoft.com/en-我们/杂志/ee677170.aspx
我将以下内容添加到我的 .config 文件中,然后它就像一个魅力:

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

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文