This project has moved and is read-only. For the latest updates, please go here.

Works locally on Win7, but not on server(2008, not R2)

Oct 22, 2013 at 3:32 PM
I'm trying to deploy a small project I've made that works fine locally. All I'm doing so far is trying to read just the test out of Word docs. I'm making my project in VS 2012, and I have a solution with a few projects, and the console app is using NetOffice. I have references to NetOffice, OfficeAPI, VBIDE, and WordApi. I'm using .Net 4.5 framework locally and I installed it on the server as well, that was 4.51. I have Office 2010 installed in the web server, though I did that after I uploaded my solution there and saw it wasn't working. I have a try-catch sending this error to the Event Log: C:\inetpub\wwwroot\Cognito2\Uploads\14-12-9@635180479299724267\TGV.docxSystem.NullReferenceException: Object reference not set to an instance of an object.
at ConvertFormatsToText.Program.WordToText(String strRootDir) in c:\Users\nikolsky\Documents\Visual Studio 2012\Projects\TextAnalyzer\ConvertFormatsToText\Program.cs:line 163

and the 4th line here is the one with the problem:
Word.Application wordApplication = new Word.Application();
            Word.Document newDocument = wordApplication.Documents.Open(strFilename);
            StreamWriter WordToText;
            string plainContent = newDocument.Content.Text;  <------- this one fails

Can you please tell me what to try next? It works fine locally. Thanks!

Oct 25, 2013 at 2:43 PM