What does System.UnauthorizedAccessException indicate ? - InfoPath Dev
in

InfoPath Dev

What does System.UnauthorizedAccessException indicate ?

Last post 08-19-2010 11:41 PM by Patrick Halstead. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 08-18-2010 07:51 AM

    What does System.UnauthorizedAccessException indicate ?

    I have a template (driving), which when various criteria are filled in, will go away and open other forms (secondary) and edit the data in them.

    I have had this working before but I have obviously changed something to make it not work.

    The secondary forms open  but when I try to create an xpath navigator on the secondary form I get this system.unauthorized access exception.

    Both the driving template and the secondary template are signed and published (by me) as content types to the same SharePoint library.

    The driving template is published with "Automatically determine" security level and the secondary template is published fully trusted.

    I notice that when running in debug opening the secondary form prompts for the InfoPathSecuityNotice(attached) - the location of the xsn is not anything I recognise - but the form opens as expected.

    I am using VB.

    returnValue = Me.Application.XmlForms.Open(filelocation, behavior) - runs ok

    testnode = returnValue.MainDataSource.CreateNavigator.SelectSingleNode(testxpath, returnValue.NamespaceManager) - fails...


  • 08-19-2010 12:35 AM In reply to

    Re: What does System.UnauthorizedAccessException indicate ?

    Hi Catharine,

    This is a common warning when you open the form from your local computer. If the form is published on a Web server, it won't happen since that's domain trust. But, locally published forms are actually more restricted.

    Patrick Halstead
    Project Manager at Qdabra
  • 08-19-2010 04:03 AM In reply to

    Re: What does System.UnauthorizedAccessException indicate ?

    The Secondary form is published to SharePoint. 

    When I run the driving form (published to sharepoint)- it fails... so there must be something wrong.

    How do I debug and find the cause of the error if System.UnauthorizedAccessException only means that I have it runing locally ?

    Catharine

  • 08-19-2010 05:07 AM In reply to

    Re: What does System.UnauthorizedAccessException indicate ?

    This permission issue might be because you are trying to access data from dataconnection you are not permitted to use. Or if user who is opening an infopath form has read only permission. Yes you won't be able to debug the code part, ideal way is remove all the references from the sharepoint and put alert to see the cause of error. Hope it helps..

    Vishal Srivastava
    Senior Software Engineer
    SDG Software Pvt Ltd
  • 08-19-2010 06:27 AM In reply to

    Re: What does System.UnauthorizedAccessException indicate ?

    Thank you for your reply... 

    I am running both forms. I have full access to all the data connections in use.  I am set up as admin in dbxl and in sql for the data connections.

    What do you mean "remove all the references from the sharepoint" ?

     

  • 08-19-2010 11:40 AM In reply to

    Re: What does System.UnauthorizedAccessException indicate ?

    Catharine,

    I am having the same issue with a web enabled form.  I believe the assembly created for custom code is failuring due to .Net access security.  I've used Process Monitor to watch what is occurring.  There is a request to the file system regarding the directory but nothing else which makes me believe .Net is blocking the access.  If anyone else has info, please add.  At this point, I believe a restructuring of the solution should take place since InfoPath was not meant to do file access work...

  • 08-19-2010 11:41 PM In reply to

    Re: What does System.UnauthorizedAccessException indicate ?

    Hi Catharine,

    Well, I'm dying to look at your screen and actually see what is happening. Let me know when you are available for a free consult.

    :)

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.