best content on how to deploy and share a VSTO solution

前端 未结 3 640
一个人的身影
一个人的身影 2020-12-28 08:24

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 ad

相关标签:
3条回答
  • 2020-12-28 09:11

    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:

    • Application Manifests for Office Solutions (2007 System)
    • Deployment Manifests for Office Solutions (2007 System)
    • Application and Deployment Manifests in Office Solutions

    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.

    0 讨论(0)
  • 2020-12-28 09:16

    For document-level deployment, I recommend the following three links:

    1. https://msdn.microsoft.com/en-us/library/ms268758(v=vs.90).aspx

    2. https://msdn.microsoft.com/en-us/library/ff937654.aspx

    3. How do you assign the Assembly Location of an Excel VSTO Installation?

    Unlike application-level solution, document-level has 2 special properties: _AssemblyLocation and_AssemblyName, which indicate the *.vsto position. To set these properties by install path, a custom action project should be created to record the target path when installing, and packaged together with setup.exe. Then you could put your excel file anywhere (on local machine) and open it in the correct way.

    0 讨论(0)
  • 2020-12-28 09:22

    I created a Excel add-on and deployed it to a server. Then I passed around two links, the setup.exe file and the link to the actual Workbook. The workbook file never changed - it's purpose was to open and load the add-on which was now in the user's Add/Remove Programs. The add-on itself would check for updates on startup.

    So if they start emailing the workbook around, great! I believe in theory, the workbook would download the add-on if it was missing, but I don't have a fresh computer around to test that. If it doesn't, it's just a simply exe to install (which will update on launch anyhow, so outdated isn't an issue).

    0 讨论(0)
提交回复
热议问题