简体   繁体   English

Unity IoC:装配体放置在哪里?

[英]Unity IoC: Where to place the assembly?

I have a few Assemblies: MyInterfaces.dll, MyImplementations.dll, MyTestApp.exe 我有一些程序集:MyInterfaces.dll,MyImplementations.dll,MyTestApp.exe

In my config I do the mapping but I get the following error during runtime: 在我的配置中,我进行了映射,但是在运行时出现以下错误:

The given assembly name or codebase was invalid. 给定的程序集名称或代码库无效。 (Exception from HRESULT: 0x80131047) (来自HRESULT的异常:0x80131047)

My question is: 我的问题是:

Do I need to register my two assembly in the GAC or do just the /bin folder of MyTestApp? 我是否需要在GAC中注册我的两个程序集,还是只执行MyTestApp的/ bin文件夹? Otherwise what am I doing wrong? 否则我做错了什么?

The assemblies should just have to be accessible to your app through any of the "normal" means (in the GAC, in the same directory, etc). 程序集仅应通过任何“常规”方式(在GAC中,同一目录中等)可被您的应用访问。

Are you using fully-qualified assembly names in your config? 您是否在配置中使用标准的程序集名称? Like: 喜欢:

MyInterfaces, Version=1.2.3.4, Culture=neutral, PublicKeyToken=b77a5c561934e089 MyInterfaces,版本= 1..2.3.4,文化=中性,PublicKeyToken = b77a5c561934e089

You could try using the Fusion Logger to see what is happening too. 您可以尝试使用Fusion Logger来查看正在发生的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM