My hat off to whoever can figure this one out... :)

G

GreatWhiteStark

Ok. Here is my problem:

I have a winform application that needs to open infopath. The XML from the
InfoPath form must never touch a hard disk due to security reasons.

As I have it right now, the winform application decrypts the xml to a
previously saved form. I then open the form using the
"NewFromSolutionWithData()" function to open up the form containing the
supplied decrypted data.

No problems so far....Works like a charm.

Then I try to make the form a "Fully Trusted" form because other features of
the form access functionality on outside .dlls.

The moment that I make the form a "Fully Trusted" form and try to run the
functionality mentioned above I get a "COMInterop" Exception. Here is a
simplified version of the code that causes the error mentioned above:

Dim infoPathApp As New InfoPath.Application()

Dim xDocCollection As InfoPath.XDocumentsCollection
xDocCollection = infoPathApp.XDocuments

Dim xDoc As InfoPath.XDocument

Dim templateLocation As String = "C:\Documents and Settings\Jared
Stark\My Documents\Visual Studio
2005\Projects\InfoPathTest\TestInfoPathForm\manifest.xsf"
Dim testData As String
testData = "<?xml version=""1.0""
encoding=""UTF-8""?><?mso-infoPathSolution name=""urn:InfoPathTest:Stark""
href=""manifest.xsf"" solutionVersion=""1.0.0.2""
productVersion=""11.0.8034"" PIVersion=""1.0.0.0"" ?><?mso-application
progid=""InfoPath.Document""?><my:myFields
xmlns:my=""http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-09-25T14-36-33""
xmlns:xd=""http://schemas.microsoft.com/office/infopath/2003""><my:prospectName>Jared Stark</my:prospectName></my:myFields>"

Dim dom As New MyInterop.MSXML5.DOMDocument()
dom.loadXML(testData)

xDoc = xDocCollection.NewFromSolutionWithData(dom, templateLocation)
 
G

GreatWhiteStark

(More details of the problem)

At first I thought maybe it was because I hadn't signed the code for the
winapp or the .dll for the infopath form. I did that.

Then I thought maybe it was because I was using the MSXML library to get a
XMLDOMNode and the Interop that was created wasn't signed either. I created
a strong-names interop assembly as well. Didn't help.
 
G

GreatWhiteStark

This is the error I get...

System.Runtime.InteropServices.COMException:

"InfoPath cannot create a new, blank form.
InfoPath cannot open the form. To fix this problem, contact your system
administrator.

Form template: file:///C:\Documents%20and%20Settings\...\manifest.xsf
The form template is trying to access files and settings on your computer.
InfoPath cannot grant access to these files and settings because the form
template is not fully trusted."

The funny thing is that it doesn't give me this error until it IS fully
trusted. It is registered and when I open it up ouside the winapp, it
indicates that it is fully trusted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top