c# - 网络办公室 Hello World

标签 c# developer-tools netoffice

几年前,我使用 VSTO 和 Visual Studio 为 Outlook 做了一些不错的小插件。但我无法证明 VS 做一些兼职项目的成本是合理的。因此,我安装了 VS 的免费版本,并下载了一个很有前途的 Office 插件工具,名为 NetOffice。

我擅长 C#,但找不到包含设置工作环境的 hello world 示例。

我安装了 VS Express,但不知道如何处理 NetOffice 程序集等才能让一个简单的示例正常工作。

我浏览了文档,发现了对“Netoffice Developer Toolbox”的引用,它为不使用完整版本 VS 的人设置了项目。这听起来正是我想要的,所以我也下载了它。

当我运行应用程序 NetOffice.DeveloperToolbox.exe 时,出现很多错误,它最终会加载,但选项卡丢失,并且似乎不起作用。

启动错误是:

An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information. | NotSupportedException | Void .ctor()

按照错误消息中的链接,您将进入具有以下描述的页面:

If you were directed to this topic because of an error message in the Visual Studio project error list or a build error, see How to: Use an Assembly from the Web in Visual Studio.

我不知道我引用了网络上的任何内容,所以不知道下一步该怎么做。

谁能告诉我我需要做什么才能让 NetOffice 正常工作,或者他们是否找到/编写了一个教程来对其进行排序 IE 一个 hello world 教程?

预先感谢您的帮助。

最佳答案

您尝试从网络位置启动 .net 程序集。 网络政策禁止这样做(通常) 将工具箱文件夹移动到您的硬盘上,一切就OK了。

NetOffice 包含发行包中每个办公产品的示例/教程。无论如何,您也可以直接从主页(netoffice.codeplex.com)在线找到很多示例,NetOffice 是 1:1 包装器,这意味着如果您已经从 VBA 或 PIA(VSTO) 了解 Office 对象模型,那么您就可以准备使用 NetOffice(您可以使用 NetOffice 中现有的 PIA 代码)。

关于c# - 网络办公室 Hello World ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25435601/

相关文章:

css - 带有指纹 Assets 的 Chrome 工作区

c# - Excel 用户定义函数锁定调用电子表格

NetOffice - IDTExtensibility2 与 ComAddin

c# - C# 中的结构数组

C# 可移植类库和具有嵌套属性的反射

c# - mvvmcross 的 AOT 问题

c# - 使 Entity Framework (使用 Linq 查询)使用自定义字段的别名而不是重做子查询

javascript - Google Chrome 中的黑盒模式

debugging - 资源的 status=canceled 在 Chrome 开发者工具中意味着什么?

c# - NetOffice Outlook 插件部署