Help required on .Net CLR version setting on application pool of IIS 8.5 RRS feed

  • Question

  • We have a WCF service hosted under IIS and runs under an application pool where the .Net Clr version is choosen as v4.0 as our application target Framework is 4.6.

    This WCF service is VB.Net code and uses c++ clr code dll for some functionality. Randomly the application users start to get errors as "The type initializer for '<Module>' threw an exception". 

    After trying to find solution online suggestion was to add 

    <startup useLegacyV2RuntimeActivationPolicy="true">

      <supportedRuntime version="v4.0"/>


    But seems this setting would not work for web.config. After this we tried to change the .Net Clr version to v2.0 in application pool  and the error does not reproduce.


    1. Once we change to V 2.0 does application still uses framework 4.0 as target framework for all code is V4?

    2. IS there a way to add the useLegacyV2RuntimeActivationPolicy in web.config



    Friday, November 17, 2017 10:54 AM

All replies