none
VSTO Manifest changes from 3.0 to 4.0 RRS feed

  • Question

  •  

    Some background: I work for a large firm that has ~500 custom document level add in dlls.  Currently, they are written in 3.5 framework using vs2008.  Due to a firm wide upgrade to w7 and excel 2010 only (no more 2k3), we are switching to VS2010 (since 2008 only works with excel 2003 and 2007).  The dll's are all hosted on an internal server via an asp.net intranet site.  The site is then responsible for moving the dll along through the appropriate environments with approvals workflows, and it also makes documents available for download to users.  In addition, the target dll is changed appropriately for the workbook as it is moved along (using the ServerDocument.AppManifest).  This has allowed us to have version control, forced updates, and multiple environments since VSTO 1.0.  Reading through the documentation regarding the new deployment changes leads me to believe this will not work with the new VSTO 4 loader.  It seems the appmanifest can no longer be embedded in the document?  Are we stuck using an installer or clickonce?  Neither fits well with our current setup without major changes.  Am i correct that this workflow is no longer possible (roughly the same for DEV,UAT,and PROD as it gets pushed along):

    1) Developer uploads workbook and dll to site

    2) Site puts dll in DEV folder,

    3) Site puts workbook in DEV documents folder

    4) Site Edits workbook's appmanifest via the server document object of the workbook in step 3, and points it to the location in step 2

     

    The site and corresponding database provide a significant amount of functionality that would be lost using click once or an installer package (or would require heavy website updates).  Also, security is simple as the user's have trusted location of our internal server's PROD and UAT folders via dns http address.  So the user just downloads the customization and is good to go without needing any privileges above User level.  Also this makes dependencies simple as they reside in the same folder on the server, so we have many shared libs and updates to these are instant across all vsto projects that reference them.

    Friday, January 10, 2014 5:48 PM

All replies

  • Hi nmarconi,

    How did you deploy the document Office solution before you migrating?

    >> It seems the appmanifest can no longer be embedded in the document?<<
    Yes, the application manifest is separately from an embedded document since Visual Studio 2010.

    >>Are we stuck using an installer or clickonce?  Neither fits well with our current setup without major changes.  Am i correct that this workflow is no longer possible (roughly the same for DEV,UAT,and PROD as it gets pushed along):<<

    Since the method is not supported by Visual Studio 2010, I think you need to modify the code to make the project work for Visual Studio 2010. You can find the deployment manifest through ServerDocument.DeploymentManifestUrl,  then you find the information of application manifest under the dependency element. More information about deploying manifest please see Deployment Manifests for Office Solutions.

    About deploying the Office solution, you can refer to articles below:

    Deploying an Office Solution

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, January 13, 2014 12:30 PM
    Moderator
  • Hi Fei,

    >> How did you deploy the document Office solution before you migrating?<<

    Here is a more detailed description of our current deoployment:


    1.  Developer creates doc-level add in for excel.

    2.  Developer uploads xls file from bin folder along with dll to server via asp.net intranet site

    3.  Site places dll in oursite/code/dev

    4.  Site places workbook in oursite/docs/dev

    5.  Version control database is updated to say a new version is in this env, including update details, req id, bug tracker id ect.

    6.  Site uses Microsoft.VisualStudio.Tools.Applications.Runtime to set ServerDocument.AppManifest.Dependency.AssemblyPath to the http path for (step 3) on the workbook file in (step 4)

    7.  Tester can now download the file from (step 4)

    8.  For UAT, steps 3-7 are repeated.

    9.  For PROD, steps 3-7 are repeated again.

    10.  Once in production, all users (integrated windows auth) can download files from oursite/docs/prod.  The users browse/search these files via a web front end with metadata ect.  All the user needs to do is download the xls file and open.  The code will load from oursite/code/prod (which also includes all dependencies - except PIAs).  The user's .net security policy is set to trust oursite/code/prod.  The only rights the user needs is the ability to save the file somewhere as no install/registration happens. All add-ins use a shared lib that is responsible for version control.  On open, the version is checked and the user is alerted to any changes.  For the purpose of keeping on topic, i skipped much built in funcitonality to the site.


    If my understanding is correct - in the new model, we would need to use deployment and app manifests (which is a more basic implimentation of our version control database).  Also, the add-in dll's will have to be installed to the users PC and registered?  Maybe we could use vstolocal to skip the install, but would still have to have the deployment and app manifest?  The issues is that the user's will not have admin rights so skipping the intall would provide the most seemless experience to the end users.

    Is there a way to "trick" Excel into thinking a project from vs2010 is from vs2008 and use the old loader?  Or create the old 3.5 style in vs2010 - even just targeting 3.5 framework?  I was able to basically do this by creating a custom project that used the old 3.5 dependencies and workbook/worksheet structure.  The problem is that VS2010 seems to be expecting the new model - so anytime you click onto the designer view for a sheet - and error occurs and the designer.vb is re-written to the new model.  Can i change the .proj file to address this?




    • Edited by nmarconi Monday, January 13, 2014 2:33 PM
    Monday, January 13, 2014 2:28 PM
  • Hi nmarconi,

    >> Site uses Microsoft.VisualStudio.Tools.Applications.Runtime to set ServerDocument.AppManifest.Dependency.AssemblyPath to the http path for (step 3) on the workbook file in (step 4) <<

    In Visual Studio 2010, you could use ServerDocument.AddCustomization Method to attach a customization to the specified document. Below is a sample for your reference:

    using Microsoft.VisualStudio.Tools.Applications;
    using System;
    
    namespace InstallDocLevelCustomization
    {
        class Program
        {
            static void Main(string[] args)
            {
                string documentPath = @"DRIVE:\path\HelloWorld.docx";
    
                var runtimeVersion = ServerDocument.GetCustomizationVersion(documentPath);
    
                if (runtimeVersion != 0)
                {
                    ServerDocument.RemoveCustomization(documentPath);
                }
    
                string deployManifestPath = @"DRIVE:\path\WordDocCustom.vsto";
    
                Uri deploymentManifestUri = new Uri(deployManifestPath);
    
                ServerDocument.AddCustomization(documentPath, deploymentManifestUri);
    
                Console.WriteLine("The document was successfully customized.");
            }
        }
    }
    

    For more information, please refer to the following articles:

    Managing Documents on a Server by Using the ServerDocument Class

    Architecture of Document-Level Customizations


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, January 20, 2014 3:07 AM
    Moderator
  • Hi,

    Thanks for the response.  Yes, i am aware of that method, but it doesnt seem to work with fully qualified domain names without allowing anonymous access to the virtual directory on the server.  Is there a way to have the serverdocument class use default credentials?

    Tuesday, January 21, 2014 3:35 PM
  • Hi nmarconi,

    >> Is there a way to have the serverdocument class use default credentials? <<

    You could use WindowsIdentity.Impersonate Method (IntPtr) to impersonate the user represented by the specified user token.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, January 23, 2014 7:05 AM
    Moderator