Here’s my small bit of code.
protected void ViewVisio(string url)
{
// open document
Microsoft.Office.Interop.Visio.Application visApp =
new Microsoft.Office.Interop.Visio.Application();
Microsoft.Office.Interop.Visio.Document visDoc = // application hangs here
visApp.Documents.Open(url);
...
}
Basically, the application just hangs forever on the line that opens the document. It never times out, even after a few hours, and it never throws an exception. I checked the Windows event logs, and there’s nothing there.
I have Office installed on my server with all the correct permissions. I’m doing the same thing with Word, Excel, and PowerPoint files and they all work just fine, so I don’t think it has anything to do with that.
So I’m at a bit of a loss here – anyone know what the issue could be?
Never run Microsoft Office under an automation context. Microsoft does not recommend or support this (see KB257757 here).