none
Using ServerDocument class in asp.net web site RRS feed

  • Question

  • Hello!

    I made a document-level add-in for Excel workbook and published it

    In my web site i expect user to fill in some text in a form, and then in a button click handler i set this text into a cached property of a document.

    It's all work fine on my machine, but when i deploy web site on my company's web server, it fails.

    The question i want to ask is: what components (minimal requirements) should be installed on a server to let ServerDocument work properly? And is there a possibility to just put some assemblies into a bin folder of my web site rather than installing a software?

    Used framework on the server is 3.5

    Wednesday, February 19, 2014 11:46 AM

Answers

  • It's all work fine on my machine, but when i deploy web site on my company's web server, it fails.

    Hi ka3yc,

    What error messages or exceptions did you get?

    To use ServerDocument class, you need to install .NET Framework and Office Tools for Visual Studio on the machine.

    I'm curious about how you built the document-level Excel add-in project and how you deployed it. Could you give us some detailed information please?


    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.


    • Edited by CaillenModerator Thursday, February 20, 2014 12:00 PM
    • Marked as answer by ka3yc Wednesday, February 26, 2014 5:00 AM
    Thursday, February 20, 2014 11:58 AM
    Moderator

All replies

  • Hello,

    First of all, please take a look at the Considerations for server-side Automation of Office article which states the following:

    Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

    If you need to customize Office documents on the server I'd suggest using the Open XML SDK instead.

    Thursday, February 20, 2014 7:18 AM
  • okay, thank you for reply, but i'm not going to automate office on server. I'm just using ServerDocument class, that does not require office installed:

    You can use the ServerDocument class in the Visual Studio Tools for Office runtime to manage several aspects of document-level customizations, even if Microsoft Office Word and Microsoft Office Excel are not installed

    Generally, i want in my server-side code to pass some data into a document, and since there is a tool for this - ServerDocument, so why not to use it?

    You can perform the following tasks:

    • Access and modify data in the data cache of a document or workbook.

    Thursday, February 20, 2014 8:35 AM
  • It's all work fine on my machine, but when i deploy web site on my company's web server, it fails.

    Hi ka3yc,

    What error messages or exceptions did you get?

    To use ServerDocument class, you need to install .NET Framework and Office Tools for Visual Studio on the machine.

    I'm curious about how you built the document-level Excel add-in project and how you deployed it. Could you give us some detailed information please?


    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.


    • Edited by CaillenModerator Thursday, February 20, 2014 12:00 PM
    • Marked as answer by ka3yc Wednesday, February 26, 2014 5:00 AM
    Thursday, February 20, 2014 11:58 AM
    Moderator
  • Thank you for the additional explanation. You are right, the ServerDocument class can be used on the server.

    Please make sure that you have VSTO runtime and .Net framework installed. The MSDN page you are referring to contains the following:

    For applications that target the .NET Framework 3.5, use the Microsoft.VisualStudio.Tools.Applications.ServerDocument class in the Microsoft.VisualStudio.Tools.Applications.ServerDocument.v10.0.dll assembly.


    But you need to have the following assemblies installed on the server:

    Microsoft.VisualStudio.Tools.Applications.ServerDocument.v10.0.dll and Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0.dll (if the project targets the .NET Framework 3.5).

    Is this the case?

    Friday, February 21, 2014 8:10 PM
  • The second part of my question was: "can i put this assemblies into the bin folder", or i should install it in GAC?

    Installing vsto  onto the server solved this issue...

    Thank you!

    Wednesday, February 26, 2014 4:58 AM
  • Installing vsto on the server expectedly solved this issue. I just wanted to know, if it possible not to install it, but just put it's assemblies into bin folder.

    Thank you for help.

    Wednesday, February 26, 2014 5:00 AM