First WCF connection made in new AppDomain is very slow

前端 未结 3 2016
不思量自难忘°
不思量自难忘° 2021-02-01 21:00

I have a library that I use that uses WCF to call an http service to get settings. Normally the first call takes ~100 milliseconds and subsequent calls takes only a few millisec

3条回答
  •  终归单人心
    2021-02-01 21:24

    You can decorate your Main with LoaderOptimization attribute to tell the CLR loader how to load classes.

    [LoaderOptimization(LoaderOptimization.MultiDomain)]
    MultiDomain - Indicates that the application will probably have many domains that use the same code, and the loader must share maximal internal resources across application domains.
    

提交回复
热议问题