从原始源路径嵌入资源? [英] Embed resource from raw source path?

查看:62
本文介绍了从原始源路径嵌入资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将一个程序集嵌入到程序集中,该程序集经常更新.我不需要每次更新嵌入式程序集时都必须手动更新资源.我希望编译器直接从程序集中获取嵌入式资源 当容器"出现时的bin路径程序集已建立.

I am embedding an assembly that gets updated often inside an assembly.  I don't want to have to manually update the resource every time I update the embedded assembly.  I want the compiler to grab the embedded resource directly from the assemblies bin path when the "container" assembly is built.  Is there a way to do this?

推荐答案

你好primm0ver,

Hello primm0ver,

这听起来可能像您要为此使用IoC.  有很多StructureMap,Unity,nInject ...

This potentially sounds like you want to use IoC for this.  There are many StructureMap, Unity, nInject...

这里的优点是您可以控制在应用程序中如何使用程序集中的类.

The advantage here is you control of how the classes in the assembly are used within your application.

另一种方法是使用Reflection扫描工作目录,以查找与您指定的名称(例如文件名模式或自定义程序集属性)相匹配的所有程序集.  

Another way is to use Reflection to scan the working directory for all assemblies that match something you specify like a filename pattern or even a custom assembly attribute.  

我的意见是尝试StructureMap;如果您不熟悉依赖项注入,那么会有一条学习曲线,但是在几个示例项目之后,您应该掌握它了.

My opinion is try StructureMap; there is a learning curve if you are not familiar with dependency injection but after a couple of sample projects you should get the hang of it.


这篇关于从原始源路径嵌入资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆