Office - Policy settings prevent opening Internet forms with managed code
Asked By Greg Collins [InfoPath MVP] on 04-Apr-07 01:25 PM
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?
--=20
Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )
Frank Mueller \(MSFT\) replied on 04-Apr-07 02:40 PM
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.
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?
--
Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )
Greg Collins [InfoPath MVP] replied on 04-Apr-07 02:56 PM
Yes, VS runs as admin, F5 or CTRL+F5.
Thanks.
--=20
Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )
Greg Collins [InfoPath MVP] replied on 04-Apr-07 02:56 PM
Yes, VS runs as admin, F5 or CTRL+F5.
Thanks.
--=20
Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )
Frank Mueller \(MSFT\) replied on 04-Apr-07 03:39 PM
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.
Yes, VS runs as admin, F5 or CTRL+F5.
Thanks.
--
Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )
Greg Collins [InfoPath MVP] replied on 04-Apr-07 04:31 PM
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
--=20
Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )
Murat Soyupak \(MSFT\) replied on 04-Apr-07 05:02 PM
Is it possible to see the solution file?
Yes, VS runs as admin, F5 or CTRL+F5.
Thanks.
--
Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )
Greg Collins [InfoPath MVP] replied on 04-Apr-07 05:13 PM
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!)
--=20
Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )
Frank Mueller \(MSFT\) replied on 04-Apr-07 06:09 PM
Is your computer part of a domain? Or is is standalone?
--
This posting is provided "AS IS" with no warranties, and confers no rights.
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
--
Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )
Greg Collins [InfoPath MVP] replied on 04-Apr-07 06:57 PM
Workgroup - no domain.
--=20
Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )
Frank Mueller \(MSFT\) replied on 05-Apr-07 11:00 PM
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
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Workgroup - no domain.
--
Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )
Greg Collins [InfoPath MVP] replied on 06-Apr-07 03:35 PM
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.
--=20
Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )
Frank Mueller \(MSFT\) replied on 06-Apr-07 04:25 PM
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.
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.
--
Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )
Greg Collins [InfoPath MVP] replied on 06-Apr-07 05:02 PM
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!
--=20
Greg Collins [Microsoft MVP]
Visit Braintrove ( http://www.braintrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )
Myles replied on 17-May-07 09:56 AM
Did you ever find an answer to this problem? I am getting the same thing, but I am running Windows XP Pro, not Vista.
Don Lyttl replied on 08-Jul-07 09:52 PM
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
Michael Mazoue replied on 14-Jul-08 12:51 AM
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...
amit jain replied on 16-Jul-08 11:15 AM
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
Patrick Kennedy replied on 22-Jul-08 11:15 AM
I added <url> to my trusted sites in IE 7.0 and that corrected the issue for me.