Debugging full-trust forms?

G

Gustaf

I'm developing an InfoPath solution in Visual Studio.NET 2003. I need to
access the file system and registry, but whenever I do that, I get an
annoying error, telling me that I'm not allowed to. Why is this
happening when I *develop* my form? It makes it extremely cumbersome to
debug full-trust forms. So far, I had to go through all the steps to
publish the form using formreg.exe to see what happens. Is there some
way to over-ride security exceptions while developing?

Gustaf
 
F

Franck Dauché

Hi Gustaf,

Dev time and publishing are 2 different things, right?
If you changed the security level of your form to Full Trust, that you
removed the publishedurl from your manifest, then all you need is a small js
file in your Managed Code project folder with the following:
oApp = WScript.CreateObject("InfoPath.ExternalApplication");
strAbsolutePath = "C:\\your project path here\\manifest.xsf"
oApp.RegisterSolution(strAbsolutePath,"overwrite");
Just double click on the js once you created it.

Now, your FT form should be correctly registered on your dev machine.

If you need to test deployment, do it on a separate test machine.

Hope that it helps.

Regards,

Franck Dauché
 
G

Gustaf

Many thanks Franck,

This makes perfect sense. Got it working now. :) I noticed that the
RegisterSolution() method makes the form appear in:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\InfoPath\SolutionsCatalog\

Do you happen to know if this is the *only* place that is affected? I
hope so, because I need to write a custom setup program to install these
forms on target computers.

Gustaf
 
F

Franck Dauché

Hi Gustaf,

Glad I could help.

Yes, the key that you mentioned is the place where urn for a fully trusted
form is stored. You can manually register or unregister templates locally by
adding / deleting entries at that location.

Regards,

Franck Dauché
 

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