本文介绍了Outlook加载项和OpenOffice的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我正在尝试通过openOffice API创建使用open office的outlook add。 我已经从openOffice引用了dll,包含了SetSecurity项目。 Add in工作正常,直到尝试连接到开放式办公室并完成某项工作。 当我在普通的VS应用程序中尝试相同的代码时,一切正常。问题在于运行OpenOffice dll的权限或从Outlook加载项使用openOffice本身。 有没有办法绕过安全性? 我' m得到以下错误: 无法加载文件或程序集'cli_uno,Version = 0.0.0.0,Culture = neutral,PublicKeyToken = null'或其依赖项之一。无法授予执行权限。 (来自HRESULT的异常:0x80131418) **************异常文本************** 系统.IO.FileLoadException:无法加载文件或程序集'cli_uno,Version = 0.0.0.0,Culture = neutral,PublicKeyToken = null'或其依赖项之一。无法授予执行权限。 (来自HRESULT的异常:0x80131418)文件名:'cli_uno,Version = 0.0.0.0,Culture = neutral,PublicKeyToken = null'---> System.Security.Policy.PolicyException:无法获取执行权限。在System.Security.SecurityManager.ResolvePolicy(证据证据,PermissionSet reqdPset,PermissionSet optPset,PermissionSet denyPset,PermissionSet& denied,Boolean checkExecutionPermission) .Security.SecurityManager.ResolvePolicy(证据证据,PermissionSet reqdPset,PermissionSet optPset,PermissionSet denyPset,PermissionSet& denied,Int32& securitySpecialFlags,Boolean checkExecutionPermission) at uno_getMappingByName(_uno_Mapping **,_rtl_uString *,_rtl_uString *,_ tl_uString *) at uno.util.to_cli< class com :: sun :: star :: uno :: XComponentContext>(参考< com :: sun :: star :: uno :: XComponentContext> * x) at uno。 util.Bootstrap.bootstrap()在Attachment2PDF.ThisAddIn.ooTest()中的C:\Documents and Settings \ Kazimierz \ My Documents\Visual Studio 2005 \Projects\Attachment2PDF \Attachment2PDF \ Thhi sAddIn.cs:第30行位于附件2PDF.ThisAddIn.ThisAddIn_Startup(对象发件人,EventArgs e)中的C:\Documents and Settings \Kazimierz \ My Documents\Visual Studio 2005 \Projects \Attachment2PDF \ Attachment2PDF \ThisAddIn.cs:第17行来自Microsoft.Office.Tools.AddIn.OnStartup() at Attachment2PDF.ThisAddIn.FinishInitialization()in C:\ Files&Settings \ Kazimierz \ My Documents \ Visual Studio 2005 \Projects\Attachment2PDF \Attachment2PDF \ ThisAddIn.Designer.cs:line 70 at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ExecutePhase(String methodName) at Microsoft .VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ExecuteCustomizationStartupCode() at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ExecuteEntryPointsHelper() at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.Microsof t.VisualStudio.Tools.Applications.Runtime.IExecuteCustomization2.ExecuteEntryPoints() 解决方案 这与信任有关外部程序集。 下面的主题讨论了可能解决方案的相同问题。 http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/7eea48fd-40f9-44fd-abe7-b804045ec292/ http://social.msdn.microsoft .COM /论坛/ EN-US / VSTO /线程/ 33326007-d51c-426F-8238-0fb38bc3eed5 / 点击 I'm trying to create outlook add in which uses open office through the openOffice API.I have referenced dll's from the openOffice, the SetSecurity project is included. The Add in works fine until it tries connect to open office and do some job.When I try the same code in normal VS application everything works fine. the problem is with the permissions to run the OpenOffice dll's or to use the openOffice itself from the Outlook add-in.Is there any way to walk around the security ? I'm getting following error:Could not load file or assembly 'cli_uno, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)************** Exception Text **************System.IO.FileLoadException: Could not load file or assembly 'cli_uno, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)File name: 'cli_uno, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.Security.Policy.PolicyException: Execution permission cannot be acquired.  at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission)  at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission)  at uno_getMappingByName(_uno_Mapping** , _rtl_uString* , _rtl_uString* , _rtl_uString* )  at uno.util.to_cli<class com::sun::star::uno::XComponentContext>(Reference<com::sun::star::uno::XComponentContext>* x)  at uno.util.Bootstrap.bootstrap()  at Attachment2PDF.ThisAddIn.ooTest() in C:\Documents and Settings\Kazimierz\My Documents\Visual Studio 2005\Projects\Attachment2PDF\Attachment2PDF\ThisAddIn.cs:line 30  at Attachment2PDF.ThisAddIn.ThisAddIn_Startup(Object sender, EventArgs e) in C:\Documents and Settings\Kazimierz\My Documents\Visual Studio 2005\Projects\Attachment2PDF\Attachment2PDF\ThisAddIn.cs:line 17  at Microsoft.Office.Tools.AddIn.OnStartup()  at Attachment2PDF.ThisAddIn.FinishInitialization() in C:\Documents and Settings\Kazimierz\My Documents\Visual Studio 2005\Projects\Attachment2PDF\Attachment2PDF\ThisAddIn.Designer.cs:line 70  at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ExecutePhase(String methodName)  at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ExecuteCustomizationStartupCode()  at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ExecuteEntryPointsHelper()  at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.Microsoft.VisualStudio.Tools.Applications.Runtime.IExecuteCustomization2.ExecuteEntryPoints() 解决方案 This is related to trusting the external assemblies.The threads below discusses the same issue with possible solution.http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/7eea48fd-40f9-44fd-abe7-b804045ec292/http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/33326007-d51c-426f-8238-0fb38bc3eed5/ 这篇关于Outlook加载项和OpenOffice的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-06 21:54