VSTO 2005 项目的布署和运行

服务器端建议:
  • 最好不要发布到带有WSS/SPS的IIS上,因为那是一件相当麻烦的事;
  • 最好使用标准的HTTP端口发布你的应用程序
  • 应用程序发布时要特别注意manifest指向正确的位置,Web.Config中的配置也指向正确的WebService。
客户端:
  • 安装.NetFramework 2.0;
  • 安装Office 2003的.Net互操作程序集组件,一般有两个办法,一是从可再发行的 Microsoft Windows Installer 包中获取。此包可以从 Microsoft 下载中心 ( http://www.microsoft.com/downloads/details.aspx?familyid=3c9a983a-ac14-4125-8ba0-d36d67e0f4ad&displaylang=en) 下载;二是重新进入Office 2003安装程序,选中与.NET相关的组件;
  • 安装VSTO 2005 Runtime(vstor.exe);
  • 用资源管理器将msosec.dll(c:\Program files\microsoft office\office11\addins)拖放到全局程序集缓存GAC(c:\windows\assembly)中,注意,本操作其实并不适合用GACUtil工具实现,因为普通客户端若不装.NetFramework SDK或其他相关开发环境,系统中不存在这个工具。
  • 将msosec.dll设为可信组件,c:\windows\microsoft.net\framework\v2.0.50727\caspol -m -addfulltrust "c:\Program files\microsoft office\office11\addins\msosec.dll";
  • 将服务器网站设为可信站点(建议);
  • 根据以下步骤设置安全策略:
    • 运行.NetFramework 2.0配置工具;
    • 创建对服务器或文件夹具有受限制权限的代码组
      • 在“计算机”节点之下展开“代码组”,再展开“All_Code”。
      • 右击“LocalIntranet_Zone”,再单击“新建”。 此步骤假定该服务器位于“本地 Intranet”区域中。如果它已被添加到 Internet 资源管理器中的“受信任站点”区域,则右击 Trusted_Zone。
      • 为代码组命名。对于此示例,使用 Customer Data Folder。 此代码组不授予该文件夹任何权限;它只作为下一个代码组的容器。
      • 单击“下一步”。
      • 在“选择此代码组的条件类型”列表中选择“URL”。
      • 在“URL”文本框中,键入指向共享文件夹的路径。 末尾处的星号很重要,因为它将权限应用于此文件夹中的所有文件以及子文件夹。例如:
        \\ServerName\ShareFolder\*,  http://ServerName/VirtualFolder/*
      • 单击“下一步”。
      • 在“使用现有权限设置”列表中选择“Nothing”。 默认值是“FullTrust”。必须将此值更改为“Nothing”,以防止为指定位置的所有文件授予完全权限。
      • 单击“下一步”,然后单击“完成”。
    • 创建授予 Office 文档完全信任的代码组:
      • 右击新代码组(在此示例中名为“Customer Data Folder”),再单击“新建”。
      • 为代码组命名。对于此示例,使用 Customer Data Documents。
      • 单击“下一步”。
      • 在“选择此代码组的条件类型”列表中选择“(自定义)”。
      • 单击“导入”,然后定位至 Office 安装文件夹中的 Msosec.xml。例如:
        C:\Program Files\Microsoft Office\Office11\Addins\Msosec.xml
      • 选择 Msosec.xml,然后单击“打开”,导入该 XML 自定义代码条件。
      • 单击“下一步”。
      • 在“使用现有权限设置”列表中选择“FullTrust”。
      • 单击“下一步”,然后单击“完成”。
    • 授予应用程序组件完全信任的代码组:
      • 右击刚才的新代码组(在此示例中名为“Customer Data Folder”),再单击“新建”。
      • 为代码组命名。对于此示例,使用 xxxx.dll 。
      • 单击“下一步”。
      • 在“选择此代码组的条件类型”列表中选择“强名称(strong name)”。
      • 单击“导入(import)”,选择xxxx.dll,确定。
      • 单击“下一步”。
      • 在“使用现有权限设置”列表中选择“FullTrust”。
      • 单击“下一步”,然后单击“完成”。
      • 若还有其他组件,重复上述步骤。
    以上步骤比较复杂,建议由管理员在某台机器上制作并导出安全策略文件(*.MSI),然后由客户端直接安装即可:
    • 运行.NetFramework 2.0配置工具;
    • 展开“我的电脑”(My Computer),右击“运行时安全策略”(Runtime Security Policy),选择“创建布署包”(Create Deployment Package),指定包文件位置;
    • 将生成的文件用组策略管理工具、SMS推到客户端,或者直接由客户端安装。



参考文档:
如何:将权限授予共享位置的文档和工作簿
(ms-help://MS.MSDNQTR.v80.chs/MS.MSDN.v80/MS.VisualStudio.v80.chs/dv_vstcore/html/89debca9-af04-4bd3-b8fb-bf14c12669cb.htm)

转载于:https://www.cnblogs.com/dotAge/archive/2006/08/15/476707.html

Professional VSTO 2005: Visual Studio 2005 Tools for Office 英文原版非影印版 Professional Visual Studio 2005 Tools for Office satisfies the need to write enterprise software based on Office by delivering practical solutions for those seeking to port existing functionality to VSTO. The book focuses on code and implementation, not theory, with code examples presented in both VB and C#. The book is especially written for enterprise developers - VBA or COM Interop savvy - who need to leverage the power and productivity of VSTO today. .NET developers seeking to explore VSTO as a potential solution will also find ample material that suits their needs. This book covers VSTO 2005 in detail. The approach focuses on the major components that form the suite with the exception that InfoPath is not covered. All other components benefit from an exploration of the key objects that are most likely to be used in common programming scenarios. This book is organized into chapters that present the building blocks of VSTO first. Microsoft Excel and its Range objects form the cornerstone of range manipulation across the VSTO suite. For that reason, the first few chapters explain these basic concepts. Subsequent chapters use these building blocks as a starting point so it is important to be familiar with these concepts before skipping to the back of the book. Once you gain a complete understanding of the Excel Range object in Chapters 2 and 3, you can apply that knowledge to the remaining chapters. In fact, Microsoft Word, Charts and Pivot Table manipulation are all based on the Excel Range object. (VSTO contains a potent charting engine second to none. And this book explores every facet of charting.) The obvious benefit of this clever architecture is that it significantly reduces the learning curve for those who wish to adopt this relatively new technology. And this book is designed to show you how to exploit this architecture.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值