Article ID: 959546 - Last Review: April 1, 2009 - Revision: 1.2 FIX: An XAML browser application returns a security exception error when you use the application to connect the WCF service in partial trust
SYMPTOMSA Windows Communication Foundation (WCF) service that is hosted in Internet Information Services (IIS) is configured to use the BasicHttpBinding binding and the WindowsAuthentication authentication. When you use an XAML browser application (XBAP) to connect the WCF service in partial trust, the XAML browser application returns a security exception error. Additionally, you receive an error message that resembles the following: System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=x, Culture=neutral, PublicKeyToken=y failed.
CAUSEThis problem occurs because the HttpWebRequest.UnsafeAuthenticatedConnectionSharing property is set to True to enable NTLM-authenticated connection sharing. This property is set to True for performance optimization. However, the setter behavior demands an unrestricted Web permission. The partial trust does not provide this permission. Therefore, the application returns a security exception error. RESOLUTIONA supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that is described in this article. Apply it only to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next service pack that contains this hotfix. To resolve this problem immediately, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft Web site: http://support.microsoft.com/contactus/?ws=support
(http://support.microsoft.com/contactus/?ws=support)
Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.PrerequisitesYou must have .NET Framework 3.5 Service Pack 1 installed to apply this hotfix.Restart requirementYou do not have to restart the computer after you apply this hotfix if no .NET Framework instance is in use.Hotfix replacement informationThis hotfix does not replace any other hotfixes.File informationThe English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.x86 version on Windows Server 2000, Windows Server 2003 and Windows XPCollapse this table
x64 version on Windows Server 2000, Windows Server 2003 and Windows XPCollapse this table
x86 version for Windows Vista SP1, Windows Server Core and Windows Server 2008Collapse this table
x64 version for Windows Vista SP1, Windows Server Core and Windows Server 2008Collapse this table
Itanium-based version for Windows Server Core and Windows Server 2008Collapse this table
WORKAROUNDTo work around this problem, set the HttpWebRequest.UnsafeAuthenticatedConnectionSharing property to False when you are using partial trust. STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. REFERENCES For more information about the partial trust feature, visit the following Microsoft Developer Network (MSDN) Web site: http://msdn.microsoft.com/en-us/library/bb412186.aspx
(http://msdn.microsoft.com/en-us/library/bb412186.aspx)
For more information about the HttpWebRequest.UnsafeAuthenticatedConnectionSharing property, visit the following MSDN Web site:http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.unsafeauthenticatedconnectionsharing(VS.71).aspx
(http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.unsafeauthenticatedconnectionsharing(VS.71).aspx)
| Other Resources Other Support Sites
CommunityArticle Translations |





















Back to the top