InfoPath Error: System.IO.FileNotFoundException - InfoPath Dev
in

InfoPath Dev

InfoPath Error: System.IO.FileNotFoundException

Last post 01-24-2011 11:56 PM by temp-x. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-24-2011 08:21 AM

    • zubair
    • Not Ranked
      Male
    • Joined on 01-08-2009
    • Karachi, Pakistan
    • Posts 5

    InfoPath Error: System.IO.FileNotFoundException

    Hi, I am trying to create an instance of SPSite in Form_Loading event of the InfoPath 2007 template. When I use: SPSite site = new SPSite("http://myserver/mysite") I get error: System.IO.FileNotFoundException: The Web application at http://myserver/mysite could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application. at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, SPUserToken userToken) at.... I am using Visual Studio 2008 on Windows 2008 R2 (64-Bit) Any suggestion?
    Muhammad Zubair Uddin
  • 01-24-2011 09:19 AM In reply to

    Re: InfoPath Error: System.IO.FileNotFoundException

    Code that uses the SharePoint object model has to be run directly on the server or you will get a FileNotFound exception.  A better practice, if possible, is to use the SharePoint web services, which do not have that restriction.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-24-2011 12:34 PM In reply to

    • zubair
    • Not Ranked
      Male
    • Joined on 01-08-2009
    • Karachi, Pakistan
    • Posts 5

    Re: InfoPath Error: System.IO.FileNotFoundException

    Thanks Jimmy for the reply... Ok I will try web service but I am unable to figure out why it is not working. I am running code on the server. I also used the same code in the console application and it was working fine!!
    Muhammad Zubair Uddin
  • 01-24-2011 11:56 PM In reply to

    Re: InfoPath Error: System.IO.FileNotFoundException

    hm, i successfully use SharePoint.DLL in my forms, but if you run it on the server (in case infopath client) or use it in web browser.

    its greatly funny InfoPath!
    you are pretty just for us!
    every day i feel your face
    InfoPath is lovely place!
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.