开发者

Unity container creation slowdown on some machines

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

The method call co开发者_如何学运维ntains 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


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.


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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜