locked
System.IO.FileNotFoundException

    Question

  • Hi,

    I have a web application in ASp.NET( just the start) , C# , and I am getting this error. What am I doing wrong. I am really new to this word app / asp.net thing. Any input is appreciated. Can someone pls help. Thank you

     

    The system cannot find the file specified.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IO.FileNotFoundException: The system cannot find the file specified.

    Source Error:

    Line 21: private void Page_Load(object sender, System.EventArgs e) Line 22: { Line 23: Word.ApplicationClass oWordApp = new Word.ApplicationClass(); Line 24: } Line 25: 

    Source File: c:\inetpub\wwwroot\wordtest\webform1.aspx.cs    Line: 23

    Stack Trace:

    [FileNotFoundException: The system cannot find the file specified.] WordTest.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\wordtest\webform1.aspx.cs:23 System.Web.UI.Control.OnLoad(EventArgs e) +67 System.Web.UI.Control.LoadRecursive() +35 System.Web.UI.Page.ProcessRequestMain() +750 
    Thursday, October 06, 2005 7:53 PM

Answers

All replies

  • Without getting into the 'running Word in a Web page' issue (which I strongly suggest that you should never do), I suspect the problem is that the ASP.NET user doesn't have read access to the directory where Winword.exe is located.
    Thursday, October 06, 2005 8:45 PM
  • Hi,

    Take a look at the Information here:
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757

    Next, ASP.NET will be running under an account with less privileges - so you will need to give access to the folder where Word resides.

    Regards,
    Vikram
    Sunday, October 09, 2005 3:42 AM