1

I am trying to develop a custom solution that makes use of the Word Automation Service but I keep running into a snag.

The reference article I am following says that I need to make use of the Microsoft.Office.Word.Server.Conversions namespace however I am getting the following build error:

The type or namespace name 'Word' does not exist in the namespace 'Microsoft.Office' (are you missing an assembly reference?)

These are the assembly references that I have in my project:

VS Assembly References

I am sure I am missing something fairly basic but I am not sure what. Any suggestions?

1

You need to reference Microsoft.Office.Word.Server which is located in the GAC (C:\Windows\Microsoft.NET\assembly\GAC_MSIL). It is not safe to reference Microsoft.Office.Interop.* assemblies in a server application.

  • That has worked! Why doesn't that assembly appear in the normal list when adding references? Also why is it unsafe to reference Microsoft.Office.Interop? – Burgi Feb 9 '16 at 9:28
  • 1
    The assembly list is pulled from C:\Windows\assembly, but in .NET 4.0, the GAC was moved to the path I previously provided. As for the Interop assemblies, KB257757 does a good job of explaining it. The Interop assemblies are used to control an Office client, and that KB goes into why using Office client for automation isn't supported for server-side code. – Trevor Seward Feb 9 '16 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.