.net - 'useLegacyV2RuntimeActivationPolicy' does not work if config file is not in installation folder -


after converting .net application 4.0v encountered problems related interop assembly, work around problem following embedded in configuration file

  <startup uselegacyv2runtimeactivationpolicy="true">     <supportedruntime version="v4.0"/>   </startup> 

however above solution fails when config file not in installation folder, know whether possible force application read above setting config file located in different folder (other installation folder) or possible programmatically achieve 'uselegacyv2runtimeactivationpolicy' tag does?

i found article solve problem.

http://reedcopsey.com/2011/09/15/setting-uselegacyv2runtimeactivationpolicy-at-runtime/

just add static class in write assembly has com interop method , well. static constructor executes when assembly loaded , sets uselegacyv2runtimeactivationpolicy you.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -