How to Publish InfoPath (which is fulltrusted having codebehid code ) in sharePoint?

浪尽此生 提交于 2021-01-29 14:27:52

问题


I created one InfoPath form which is having C# code and i gave security option is 'full trusted' to access infopath object model,and it should be open with Browser.finally i published the Infopath form to SharePoint(by using admin-approved) site.

But when i'am trying to open, it is not opening and giving an error that is 'InfoPath can not create a new or blank form InfoPath can not open the form,To fix this problem,Contact your System administrator'

and in error show details its giving following message. 'The form template is trying to access files and settings on your computer. InfoPath cannot grant access to these files and settings because the form template is not fully trusted. For a form to run with full trust, it must be installed or digitally signed with a certificate'.

please give me a solution.


回答1:


Unfortunately, if you are using any file system calls in your C# code then you will have to keep the fully trusted setting. As the error message says, any fully trusted form has to be either installed or have a certificate associated with it to run. Infopath is really just a glorified webpage when it runs on a users machine - you wouldn't want a webpage to run unsecurely and have full rights to the machine without the user knowing it.

You should only need full trust if the form accesses LOCAL resources (indivdiual hard drives). If you don't include C# libraries for file/directory access then domain trust should be sufficient and the form will work fine. (Database access, webservices, etc are not local and will work under domain level).




回答2:


In the Form Setting change the browser enabled documents as "Display as Web Page". it resolved the issue :)



来源:https://stackoverflow.com/questions/2490257/how-to-publish-infopath-which-is-fulltrusted-having-codebehid-code-in-sharepo

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