How to make AutomationFactory available for a silverlight application in a sharepoint site?

烈酒焚心 提交于 2019-12-13 04:18:49

问题


I am trying to create a silverloght application to open visual studio and deploy it as a webpart in sharepoint site. I am using following code:

dynamic cmd = AutomationFactory.CreateObject("WScript.Shell"); cmd.Run("devenv.exe", 1, true);

this is working fine in standalone silverlight application, however, when I added this as a webpart in sharepoint site. It gives an error that "This operation is not supported in the current context".

Based on my search, the reason for this may be is that AutomationFactory is not available for this application as it requires elevated permission.

Do I have to provide elevated Permission to sharepoint site, if yes, then how to do it?


回答1:


You need perform some configuration to allow use AutomationFactory:

  1. Use silverlight 5 (version 4 is not allow it)
  2. Set registyry key to allow in-browser elevated mode
  3. Sign Xap with certificate, that installed in user's certificate store in "trusted root"
  4. Install silverlight application on client machine

You can find right a way by googling, it described in many blogs



来源:https://stackoverflow.com/questions/11429532/how-to-make-automationfactory-available-for-a-silverlight-application-in-a-share

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!