Managed code forms that use simple code like System.Environment.Username will fail with a security exception for form templates with domain trust when launched from an Internet IE zone.
Here are the options:
- Remove Trusted Site setting for the intranet site.
- Pro: this is the best approach since intranet sites shouldn't have to be added to Trusted Sites.
- Con: could be lots of work if you have other solutions that require IE Trusted Sites.
- Make InfoPath form template full trust and require digital certificates and signing.
- Pro: this is another recommended solution.
- Con: digital certificates can require a lot of configuration and installation; adoption still low.
- Move form libraries to a different server.
- Pro: this is a workaround that gives us ultimate independence and flexibility.
- Con: it’s more work to move the form library.
- Create a .NET Deployment MSI for Machine code group.
- Pro: this is an easy thing to do.
- Con: overwrites the existing .NET Machine settings for all clients where it is installed.