locked
Cannot use Microsoft.Office.Interop.Word.dll with worker role RRS feed

  • Question

  • Hi all,

    I am getting a major issue. I want to use Microsoft.Office.Interop.Word.dll in windows azure with worker role so I installed MS Office in virtual machine which is running worker role. There is a weird there, I tried run an executable file to use Microsoft.Office.Interop.Word.dll on that machine then it works fine but when I used Microsoft.Office.Interop.Word.dll in worker role it always threw null reference exception.

    Do you guys know what problem happened to worker role or has any restriction with worker role when using Microsoft.Office.Interop.Word.dll.

    I really need your help, this issue took me more than two weeks to investigate.

    Thanks,

    Phuong

    Wednesday, January 16, 2013 8:52 AM

Answers

  • It was in GAC, there is a helpful information 

    I saw that Documents.Open returned null and someone says that 

    64 bit system stores temporary files in "C:\Windows\SysWOW64\config\systemprofile\Desktop" folder.

    The solution: create a new directory called "Desktop" inside "C:\Windows\SysWOW64\config\systemprofile\"

    Can I create this folder with startup command line?

    • Marked as answer by minh phuong Thursday, January 17, 2013 3:30 AM
    Wednesday, January 16, 2013 9:23 AM

All replies

  • The dll should be referenced locally (and included) as part or your worker role package.
    • Proposed as answer by XinTW Wednesday, January 16, 2013 9:10 AM
    Wednesday, January 16, 2013 9:10 AM
  • It was in GAC, there is a helpful information 

    I saw that Documents.Open returned null and someone says that 

    64 bit system stores temporary files in "C:\Windows\SysWOW64\config\systemprofile\Desktop" folder.

    The solution: create a new directory called "Desktop" inside "C:\Windows\SysWOW64\config\systemprofile\"

    Can I create this folder with startup command line?

    • Marked as answer by minh phuong Thursday, January 17, 2013 3:30 AM
    Wednesday, January 16, 2013 9:23 AM
  • Create powershell script with:

    md -Path 'C:\Windows\SysWOW64\config\systemprofile\Desktop'

    Run the powershell script elevated from your worker role on startup.

    Saturday, January 19, 2013 3:51 PM