Unity container creation slowdown on some machines

耗尽温柔 提交于 2019-12-23 03:49:11

问题


On my develop machine all ok, but when I try app on test machine with WinXp sp3 I encountered a problem.

The method call contains the code below takes 1,5 minute

var c = new UnityContainer();

Unity version 2.0.414.0 .Net Framework v 3.5 sp1

Does any one know how to fix it?

Thanks


回答1:


Does your test machine have internet access? If not, it could be hanging trying to verify the authenticode certificate on the binary. A quick test would be to build Unity from source and use that dll instead. If it doesn't hang then that was the problem. There's a way turn off the cert check in the app.config file; I'll update this answer once I get a chance to look it up.




回答2:


I don't know if it will make a different or not, but you can try this instead.

UnityContainer c = new UnityContainer();
OR
IUnityContainer myContainer = new UnityContainer();

Also, have you done the following:

  1. Provide an XML format configuration file that adheres to the schema shown in Source Schema for the Unity Application Block.
  2. Use the methods of the container to add specific registration entries for default and named mappings.
  3. Use the container configuration API to provide a custom configuration for the container.

Maybe this can help:

http://msdn.microsoft.com/en-us/library/ff648211.aspx



来源:https://stackoverflow.com/questions/4399764/unity-container-creation-slowdown-on-some-machines

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!