none
Popup message appearing when opening a document, "Common Language runtime could not be loaded by \\NetworkLocation\Sample.doc Contact your administrator for further assistance". RRS feed

  • Question

  • Hello Team,

    I have developed a Word document level customization using VSTO 2010 with Office 2010. I am saving the genereated docuemts on shared location. Now from server (which has VSTO 2005 & Office 2007 & .Net Framework 4.0 installed) when I tru to open the document using following code, I got a popup message with text

    "Common Language runtime could not be loaded by \\NetworkLocation\Sample.doc Contact your administrator for further assistance".

    Surprisingly, If I click the OK button of the message, it generated the PDF succesfully. Since below code is part of automated service, popup message blocks the further execution. How can I suppress this message or fix the problem so that popup doesn't come? Thanks.

        Document doc = word.Documents.Open(ref filename, ref oMissing,
           
    ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
           
    ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
           
    ref oMissing, ref oMissing, ref oMissing, ref oMissing);
        doc
    .Activate();

       
    object outputFileName = wordFile.FullName.Replace(".doc", ".pdf");
       
    object fileFormat = WdSaveFormat.wdFormatPDF;

       
    // Save document into PDF Format
        doc
    .SaveAs(ref outputFileName,
           
    ref fileFormat, ref oMissing, ref oMissing,
           
    ref oMissing, ref oMissing, ref oMissing, ref oMissing,
           
    ref oMissing, ref oMissing, ref oMissing, ref oMissing,
           
    ref oMissing, ref oMissing, ref oMissing, ref oMissing);

    http://stackoverflow.com/questions/607669/how-do-i-convert-word-files-to-pdf-programmatically

    Friday, June 26, 2015 4:28 AM

Answers

  • Hi Pushkar_Dev,

    This is a know issue. Please ensure that the version of the Microsoft .NET Framework on the end user's computer must be the same as or older than the version on the computer that was used to develop the solution.

    You can get more detail about this issue from link below:
    Troubleshooting in Office at Run Time

    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, June 29, 2015 5:47 AM
    Moderator

All replies

  • Hello Pushkar,

    Add-ins are client side things.

    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 are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution. You can read more about this in the Considerations for server-side Automation of Office article.

    You may consider using any third-party components designed for the server-side execution. Also take a look at the Open XML SDK, see Welcome to the Open XML SDK 2.5 for Office for more information.

    Friday, June 26, 2015 12:58 PM
  • Hi Pushkar_Dev,

    This is a know issue. Please ensure that the version of the Microsoft .NET Framework on the end user's computer must be the same as or older than the version on the computer that was used to develop the solution.

    You can get more detail about this issue from link below:
    Troubleshooting in Office at Run Time

    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, June 29, 2015 5:47 AM
    Moderator