Policy settings prevent opening Internet forms with managed code

  • Thread starter Greg Collins [InfoPath MVP]
  • Start date
G

Greg Collins [InfoPath MVP]

I've got a clean Vista Ultimate install with Office 2007 Ultimate and Visual Studio 2005 SP1.

If I create a new InfoPath C# project from Visual Studio, and then try to preview it, I get the following dialog:

InfoPath cannot open the selected form.

If I attempt to launch the form template by right-clicking the manifest.xsf file and choosing Open, I get the following error message:

InfoPath cannot create a new, blank form.
InfoPath cannot open the form. To fix this problem, contact your system administrator.
DETAILS>>
Form template: {path}\manifest.xsf
InfoPath cannot open the selected form because of an error in the form's code.
Policy settings prevent opening Internet forms with managed code. To fix this problem, contact your system administrator.


As it is a new blank form, there is no code to cause an error yet.
And I am the system administrator...

This is true using VSTA or VSTO.

I found that if I set the form to Full-Trust, that I can preview the form from Visual Studio.

What's going on here? What are these policy settings (I assume they are Vista related), and how do I fix them?
 
F

Frank Mueller \(MSFT\)

Hi Greg,

are you running Visual Studio with elevated priviliges (administrative
rights) as recommended on Vista? How are you trying to preview the InfoPath
project from VS? By Pressing F5?

Thanks,
Frank

--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Greg Collins [InfoPath MVP]" <gcollins_AT_msn_DOT_com> wrote in message
I've got a clean Vista Ultimate install with Office 2007 Ultimate and Visual
Studio 2005 SP1.

If I create a new InfoPath C# project from Visual Studio, and then try to
preview it, I get the following dialog:

InfoPath cannot open the selected form.

If I attempt to launch the form template by right-clicking the manifest.xsf
file and choosing Open, I get the following error message:

InfoPath cannot create a new, blank form.
InfoPath cannot open the form. To fix this problem, contact your system
administrator.
DETAILS>>
Form template: {path}\manifest.xsf
InfoPath cannot open the selected form because of an error in the form's
code.
Policy settings prevent opening Internet forms with managed code. To fix
this problem, contact your system administrator.


As it is a new blank form, there is no code to cause an error yet.
And I am the system administrator...

This is true using VSTA or VSTO.

I found that if I set the form to Full-Trust, that I can preview the form
from Visual Studio.

What's going on here? What are these policy settings (I assume they are
Vista related), and how do I fix them?
 
F

Frank Mueller \(MSFT\)

Let's see if we can figure this out.

1. When you create a blank form template, do you create it on your local
computer or some share?
2. Can you open the form when you publish it from VS to a shared location?

Thanks,
Frank

--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Greg Collins [InfoPath MVP]" <gcollins_AT_msn_DOT_com> wrote in message
Yes, VS runs as admin, F5 or CTRL+F5.
Thanks.
 
G

Greg Collins [InfoPath MVP]

I just uninstalled and reinstalled VSTO as well..

1. I create the blank new template on the local drive.
2. I published to C:\folder\test.xsn and get the same error: policy setting
 
M

Murat Soyupak \(MSFT\)

Is it possible to see the solution file?


"Greg Collins [InfoPath MVP]" <gcollins_AT_msn_DOT_com> wrote in message
Yes, VS runs as admin, F5 or CTRL+F5.
Thanks.
 
G

Greg Collins [InfoPath MVP]

I've dropped a zip of the solution folder to http://www.braintrove.com/testA.zip

This is just a default InfoPath 2007 C# solution that was created, and then an attempt made to preview it.

I still think this has something to do with Vista settings... but I can't figure out why other people aren't having the same issue (or at least aren't complaining about it!)
 
F

Frank Mueller \(MSFT\)

Is your computer part of a domain? Or is is standalone?

--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Greg Collins [InfoPath MVP]" <gcollins_AT_msn_DOT_com> wrote in message
I just uninstalled and reinstalled VSTO as well..

1. I create the blank new template on the local drive.
2. I published to C:\folder\test.xsn and get the same error: policy setting
 
F

Frank Mueller \(MSFT\)

Hi Greg,

Please try the following open regedit on your machine (only do so if you
know what you are doing) and navigate to

HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\InfoPath\Security

In there I am suspecting is a value called "RunManagedCodeFromInternet"
which is set to 0. Please set the value to 1 and try your scenarios again.

Thanks,
Frank
 
G

Greg Collins [InfoPath MVP]

Frank - There is no Security under InfoPath at that location. I have: Designer, EditorComon, Internet Explorer, Language, Recent File List, Recent Templates, and Resiliency.

Should I have one? I recently uninstalled Office 2007 Pro and installed Office 2007 Ultimate. I made sure that all of the InfoPath features were installed.
 
F

Frank Mueller \(MSFT\)

No, by default we don't create the security key. So here's what I think is
going on - Somehow the path to your XSN is considered to be in the Internet
zone, which means we apply stricter security rules. What security zone your
path/url maps to is determined by the Internet Explorer settings.
Unforunately, I cannot tell you what setting exactly would be causing this.
I would recommend defaulting all your security settings.

If that does not work you could consider adding the reg key/value that I
pointed out. This will basically permit InfoPath to run managed code even if
it's from the Internet. Obviously that could be a security risk, so I would
advise to be careful, but you could see if it solves the issue temporarily.

Let me know the outcome.
Thanks,
Frank

--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Greg Collins [InfoPath MVP]" <gcollins_AT_msn_DOT_com> wrote in message
Frank - There is no Security under InfoPath at that location. I have:
Designer, EditorComon, Internet Explorer, Language, Recent File List, Recent
Templates, and Resiliency.

Should I have one? I recently uninstalled Office 2007 Pro and installed
Office 2007 Ultimate. I made sure that all of the InfoPath features were
installed.
 
G

Greg Collins [InfoPath MVP]

Strangely enought, that didn't do it for me. I've double checked teh string value name and data. I tried rebooting after adding it. Still not working. Hmm.

Perhaps it has something to do with the Internet Security settings themselves, or one of the apps in the Vista Security Center? I've got the MS version eTrust Antivirus so I can RAS into corpnet.

I'm really at a loss!
 
G

Greg Collins [InfoPath MVP]

And here I thought it was a Vista only problem :eek:)

Sorry - still no luck on this. I've tried everything I could think of and everything others could suggest.
 
D

Don Lyttle

After installing Internet Explorer 7, my InfoPath 2007 forms no longer open.
I get the same error as Greg mentions below. When I click on "Show Details",
it says that I have a "code" problem. I do have .NET Framework 2.0 and MSXML
6.0 installed. When I uninstall IE7 and restore IE6, everything goes back to
working properly again. My OS is Windows XP Pro.

Does this mean I'm stuck with IE6? What'll happen to those users opening my
forms on computers having IE7?

Thanks In Advance!
Don
 
M

Michael Mazoue

I have a Vista Ultimate machine. I installed InfoPath the other week and it was working fine until I tried adding a button onto the form. After I added the button and tried to add some code to the button, I couldnt preview the form. I dont have a solution to the problem but I have found that if I deleted the code the previewing worked again. The problem is I cannot use code now...
To delete the code...open up infopath, open the forms that dont work in preview mode, goto the Tools Menu > Form Options. Goto the programming category and click on the 'Remove code' button.
Dont know if that helps anyone here...
 
D

Don Reamey \(MSFT\)

I'm running vista ultimate right now and I have not run into this problem.

Is this a consistent issue you have run into?

Can you always repro this behavior on the same form or on any form?

--
Don Reamey
Software Development Engineer
InfoPath Forms Server
Microsoft Corporation
http://blogs.officezealot.com/dreamey


in message news:[email protected]...
 
A

amit jain

Try putting the link in the safe list settings i.e. in internet options -> security -> Trusted sites

worked for me atleast.

my OS is XP
 

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