关于如何部署和共享VSTO解决方案的最佳内容 [英] best content on how to deploy and share a VSTO solution

查看:170
本文介绍了关于如何部署和共享VSTO解决方案的最佳内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

推动利用视觉工作室和dotnet与办公室的解决方案,特别是excel,哪里是最好的文章或信息,如何具有额外的二进制文件和程序集的办公桌是可共享的。


  1. 将此外部代码与电子表格打包

  2. 如果人们开始向电子表格发送电子邮件。这个附加组件是否有任何开销。有二进制文件脱离电子表格的风险

看起来像微软一直在推动VSTO超过5年,但你读了很多混合的评论和问题。我们在做大型VBA excel解决方案的公司是否可以完全迁移到dotnet,没有任何真正的担忧?

总而言之,我想回答你关于VSTO是否为更大的实现做好准备的问题。答案是YES!特别是如果替代方案是VBA。您有整个.Net框架可用,您可以使用Web服务,ADO.Net(更好的是与企业库)。您仍然可以编写看起来很像VBA的代码,但功能更强大。您可以阅读演练:为Excel创建您的第一个文档级自定义此页面将让您了解VSTO功能可用于您。



现在,回答你的部署问题。



这取决于你是否正在制作一个Add-在或文档级定制。如果它是一个加载项,那么您必须将它安装在每个客户端上,并且任何传递文档都不会影响(加载项在应用程序级,而不是在单个文档级别)。



我假设你正在谈论一个文档级别的定制,所以我将围绕我的答案集中。



当你创建一个文档级别自定义,程序集不会加载到Excel文件(与VBA一样)。相反,添加了一个文档属性,告诉应用程序该文档包含一个清单文件(并告知它清单文件的位置)。清单文件包含组成您的自定义的程序集的链接。



与任何.Net应用程序一样,有时还需要部署其他(引用)程序集。 GAC中的这些程序集并不总是这样,因此它们必须位于与执行程序集(在本例中为您的定制程序集)相同的文件夹中。您不一定必须将您的程序集放置在与您的excel文件相同的位置。



有几种方法可以部署自定义


  1. 您可以将所有程序集和excel文件存储在一个文件夹中,并以这种方式运行应用程序(如果传递了excel文件,则用户必须绕过整个文件夹)。

  2. 您可以运行安装程序,将程序集安装到用户计算机上的特定文件夹中,并在该位置指定清单(如果传递了excel文件,用户还必须绕过安装程序)。

  3. 您可以在网络中安装程序集位置,并在文档属性中指定清单和程序集都位于该网络位置(如果是excel f ile被传递,没有什么需要与它一起传递 - 但是有安全设置需要做。有关详细信息,请参阅此页面)。

任何你决定这样做的方式,这里是您需要阅读的页面,以了解启用自定义的文档属性。



您需要确保所有用户都有安装的先决条件。最简单的方法是给他们所有的安装程序。如果您为自定义创建安装项目,则可以设置引导程序以自动安装先决条件。如果您使用 ClickOnce 安装自定义功能,也可以执行此操作。 此页面将为您提供有关部署所需的所有信息。



以下是您需要查看的其他一些有用的链接:





我希望这有帮助。一旦阅读了所有这些信息,我想你会同意VSTO比VBA更好的选择。您只需要仔细规划您的部署。


with the push to leverage visual studio and dotnet with office based solutions, especially excel, where is the best article or information on how having office sheet with additional binaries and assemblies is sharable.

  1. Do this external code get packaged with the spreadsheet
  2. what if people start emailing the spreadsheet around. Is there any overhead of this additional assemblies. Is there risk of the binaries getting detached from the spreadsheet

It seems like microsoft has been pushing VSTO for over 5 years now but you read lots of mixed reviews and issues. Are we at the point where companies that do large VBA excel solutions can fully migrate over to dotnet without any real worries?

解决方案

First of all, I want to answer your question on whether or not VSTO is ready for larger implementations. The answer is YES! Especially if the alternative is VBA. You have the entire .Net framework available, you can use web services, ADO.Net (better still, with the enterprise library). You can still write code that looks a lot like VBA, but is much more powerful. You can get more information by reading Walkthrough: Creating Your First Document-Level Customization for Excel. This page will give you an idea of what VSTO features are available to you.

Now, to answer your question on deployment.

It depends on whether you are making an Add-In or a document level customization. If its an Add-In, then you must install it on each client, and any passing around of documents will not effect that (Add-Ins are at the application level, and not at the individual document level).

I assume that you are talking about a document level customization, so I will center my answer around that.

When you create a document level customization, the assemblies are not loaded into the excel file (as they are with VBA). Instead, a document property is added telling the application that this document contains a manifest file (and tells it of the manifest file's location). The manifest file contains links to the assembly that makes up your customization.

As with any .Net application, there are sometimes other (referenced) assemblies that also need to be deployed. Not always are these assemblies in the GAC, so they would have to be located in the same folder as your executing assembly (in this case, your customization assembly). You don't necessarily have to place your assemblies in the same location as your excel file, though.

There are a few ways you can deploy the customization.

  1. You can store all of the assemblies and the excel file in a folder and run the application that way (if the excel file is passed around, the users must pass around the entire folder).
  2. You can run an setup program that installs the assemblies to a specific folder on the users computer, and specifies the manifest at that location (if the excel file is passed around, the users must also pass around the setup program).
  3. You can install the assemblies in a network location and specify in the document properties, that the manifest and the assemblies are all at that network location (if the excel file is passed around, nothing needs to be passed along with it - but there are security settings that need to be made. Read this page for more information).

Any way that you decide to do this, here is the page you need to read in order to understand the document properties that enable the customization.

You need to make sure all of your users have the prerequisites installed. The easiest way to do this is to give them all a setup program. If you create a setup project for your customization, you can setup the bootstrapper to automatically install the prerequisites. You can also do this if you use ClickOnce to install the customization. This page will give you all the information you need to know regarding deployment.

Here are some other helpful links you will need to see:

I hope this helps. Once you read all of this information, I think you'll agree that VSTO is a much better choice than VBA. You just have to plan your deployment carefully.

这篇关于关于如何部署和共享VSTO解决方案的最佳内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆