Problem and Solution : Dynamic operations can only be performed in homogenous AppDomain.

Sharing is Caring

If u have ever used “dynamic” keyword in your webpart code,its 100% possibility you will meet this error.

Its because using dynamic operation in same appdomain as sharepoint is not supported in new LegacyCASModel.

So heres a workaround i did to make it work:

if you wrote a timerjob, edit owstimer.config otherwise edit web.config:

Instead of this:
<trust level=”Full” originUrl=”” legacyCasModel=”true” />

Use this:
<trust level=”Full”  />

and add this to <configuration><runtime>:
<NetFx40_LegacySecurityPolicy enabled=”false”/>

Hope it helps

Related posts

4 Thoughts to “Problem and Solution : Dynamic operations can only be performed in homogenous AppDomain.”

  1. Thanks for the tip, I am having similar error while using Office’s add-in with Sharepoint 2013 Online connection. I don’t know if I should place this configuration on the web that is running the app or the packet that is sent for sharepoint. I put it on both. But this part:

    I think instead of trust level you mean trustLevel and level would be name instead. Still I am having the same error described in here. Thanks for the help. 🙂

    1. This works in On-Premise SharePoint portals where you can access web.config.Dont know If you can access web.config in Office 365.I’d like much to know If you solved this.

  2. srinivas

    still i am facing issue in my production,working fine in dev system

  3. Eylon Sultan

    Thanks a lot! The only one who mentioned that for TimerJobs there’s a different config file…

Leave a Comment