开发者

Embed Assembly in Winforms application

I have a winforms application which is built dynamically by another application, now the code in the winforms application needs to reference an assembly which I have in a dll. I'd like to embed this in the winforms application somehow so that it doesn't need to be sent with the application to the client.

I've tried the compilerParams.ReferencedAssemblies.Add method but this does seem to let me run the application without still having the assembly in the directory with the application.

I've also tried putting the assembly in the resources of the winforms application and then pulling this back out in the runtime of the winforms application using Assembly.Load, the only problem here is that any references to the assembly don't seem to work so by the look of it I'd have to use reflection to identify the methods in the Assembly dynamically which isn't ideal.

Essentially m开发者_JAVA百科y question is what's the best way to do this!


Have a look at the ILMerge tool.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜