在IIS下运行时使用Sync Framework工具包的安全异常 [英] Security Exception with Sync Framework toolkit when running under IIS

查看:94
本文介绍了在IIS下运行时使用Sync Framework工具包的安全异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了Sysnc Framework Toolkit并根据帮助文件(.chm)配置了示例ListService项目。


这样可行,但在尝试选项"使用"之后本地Web服务器"来自VS2010中的withIn项目属性(首先按"创建虚拟目录"),然后它不起作用,我收到以下错误:



同步失败:system.security.SecurityException - > .....


...................... internalendgetresponse(IAsyncResult asyncResult)


如果我然后改回" ;使用Visual Studio Development Server"一切都有效。


我注意到如果我点击调试 - >例外 - > clrexceptions - >抛出,它会失败:


HttpCacheRequestHandler。 OnDownloadGetResponseCompleted, 说明:


AsyncWaitHandle ='asyncResult.AsyncWaitHandle'引发了类型'System.NotSupportedException'的异常


base {System.SystemException} = {System.NotSupportedException:不支持指定的方法。

  在System.Net.Browser.BHWRAsyncResult.get_AsyncWaitHandle()}


我正在使用Windows 7个电脑,VS2010 SP1


另外如果帮助我的诊断在VS2010网络服务器下运行时,$就可以了,但是当显示为IIS时,它说:



< tbody>






ClientAccessPolicy.xml / CrossDomain.xml文件 FAILED                  找不到clientaccesspolicy.xml或crossdomain.xml文件。从其他域调用服务的Silverlight客户将                 
无法成功提出请求。                 


在fiddler中运行我可以看到clientaccesspolicy文件的以下详细信息:


<!DOCTYPE html PUBLIC" - // W3C // DTD XHTML 1.0 Strict // EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict。 DTD ">


< html xmlns =" http://www.w3.org/1999 / XHTML ">


< head>

< title> IIS 7.5详细错误 - 401.2 - 未经授权< / title>

< style type =" text / css">

<! -

body {margin:0; font-size:.7em; font-family:Verdana,Arial,Helvetica,sans-serif; background: #CBE1EF;}


代码{margin:0;颜色:#006600; font-size:1.1em; font-weight:bold;}

。 config_source code {font-size:.8em; color:#000000;}

pre {margin:0; font-size:1.4em; word-wrap:break-word;}

ul,ol {margin:10px 0 10px 40px;}

ul.first,ol.first {margin-}

fieldset {padding:0 15px 10px 15px;}

.summary-container fieldset {padding-bottom:5px; margin-}

legend.no-expand-all {padding:2px 15px 4px 10px; margin :0 0 0 -12px;}

legend {颜色:#333333;填充:4px 15px 4px 10px;保证金:4px 0 8px -12px; _margin-

  border-border-border-right:1px solid#969696;

  border-bottom:1px solid#969696;背景:#E7ECF0; font-weight:bold; font-size:1em;}


a:链接,a:已访问{color:#007EFF; font-weight:bold;}

a:hover {text-decoration:none;}

h1 {font-size: 2.4em;保证金:0;颜色:#FFF;}

h2 {font-size:1.7em;保证金:0;颜色:#CC0000;}

h3 { font-size:1.4em; margin:10px 0 0 0; color:#CC0000;}

h4 {font-size:1.2em; margin:10px 0 5px 0;

} #header {width:96%; margin:0 0 0 0; padding:6px 2%6px 2%; font-family:" trebuchet MS" Verdana,sans-serif;


 颜色:#FFF;背景颜色:#5C87B2;

} #content {margin:0 0 0 2%;}

.summary-container,。content-container {background:#FFF; width:96%; margin -padding:10px;}


.config_source {background:#ffff5c4;}

.content-container p {margin:0 0 10px 0;

}#details-left {width:35%; float:left; margin-right:2%;

}#details-right {width:63%; float:left;

} #server_version {width:96%; _ height:1px; min-height:1px; margin:0 0 5px 0; padding:11px 2%8px 2%; color:#FFFFFF;


  background-color:#5A7FA5; border-bottom:1px solid#C1CFDD; border-font-weight:normal;


  font-size:1em; color:#FFF; text-align:right;

} #server_version p {margin:5px 0;}

table {margin:4px 0 4px 0; width:100%; border:none;}

td,th {vertical-align:top; padding:3px 0; text-align:left; font-weight:bold; border:none;}


th { width:30%; text-align:right; padding-right:2%; font-weight:normal;}

thead th {background-color:#ebebeb; width:25%;

}#details-right th {width:20%;}

table tr.alt td,table tr.alt th {background-color:#ebebeb;}

.highlight-code {color:#CC0000; font-weight:bold; font-style:italic;}

.clear {clear:both;}

.preferred {padding:0 5px 2px 5px; font-weight:normal; background:#006633; color:#FFF; font-size:.8em;}


- >

< / style>

 

< / head>

< body>

< div id =" header">< h1>应用程序中的服务器错误" DEFAULT WEB SITE"< / h1>< / div>


< div id =" server_version">< p> Internet Information Services 7.5< / p>< / div>


< div id =" content">

< div class =" content-container">

 < fieldset>< legend>错误摘要< / legend>

  < h2> HTTP错误401.2 - 未经授权< / h2>

  < h3>由于身份验证标头无效,您无权查看此页面。< / h3>


 < / fieldset>

< / div>

< div class =" content-container">

 < fieldset>< legend>详细错误信息< / legend>

  < div id =" details-left">

   < table border =" 0" CELLPADDING = QUOT; 0" CELLSPACING = QUOT; 0">

    < tr class =" alt">< th> Module< / th>< td> IIS Web Core< / td>< / tr>


    < TR><的第i;通知和LT; /第>< TD> AuthenticateRequest< / TD>< / TR>


    < tr class =" alt">< th> Handler< / th>< td> StaticFile< / td>< / tr>


    < tr>< th>错误代码< / th>< td> 0x80070005< / td>< / tr>


    

   < /表>

  < / DIV>

  < div id =" details-right">

   < table border =" 0" CELLPADDING = QUOT; 0" CELLSPACING = QUOT; 0">

    < tr class =" alt">< th>请求的网址< / th>< td> http:// localhost:80 / crossdomain.xml< / td>< / tr>


    < tr>< th>物理路径< / th>< td> C:\inetpub \ www.root \crossdomain.xml< / td>< / tr>


    < tr class =" alt">< th>登录方法< / th>< td>尚未确定< / td>< / tr>


    < tr>< th>登录用户< / th>< td>尚未确定< / td>< / tr>


    

   < /表>

   < div class =" clear">< / div>

  < / DIV>

 < / fieldset>

< / div>

< div class =" content-container">

 < fieldset>< legend>最有可能的原因:< / legend>

  < UL>  < li>在IIS中未选择身份验证协议(包括匿名)。< / li>  < li>仅启用了集成身份验证,并且使用了不支持集成身份验证的客户端浏览器。< / li>
 < li>已启用集成身份验证,并且请求是通过代理发送的,该代理在到达Web服务器之前更改了身份验证标头。< / li>  < li>未配置Web服务器进行匿名访问,并且未收到所需的
授权标头。< / li>  < li>"configuration / system.webServer / authorization""配置部分可以明确地拒绝用户访问。< / li> < / UL>


 < / fieldset>

< / div>

< div class =" content-container">

 < fieldset>< legend>您可以尝试的事项:< / legend>

  < UL>  < li>验证资源的身份验证设置,然后尝试使用该身份验证方法请求资源。< / li>  < li>验证客户端浏览器是否支持集成身份验证。< / li>
 < li>使用集成身份验证时,验证请求是否未通过代理。< / li>  < li>验证用户未在"configuration / system.webServer / authorization"中明确拒绝访问权限。配置
部分。< / li>  < li>创建跟踪规则以跟踪此HTTP状态代码的失败请求。有关为失败的请求创建跟踪规则的更多信息,请单击< a href =" herehttp://go.microsoft ?的.com / fwlink /链路ID = 66439">此处< / A 取代。
< / li> < / UL>

 < / fieldset>

< / div>

 

 

< div class =" content-container">

 < fieldset>< legend>链接和更多信息< / legend>

 当服务器配置不支持发送到Web服务器的WWW-Authenticate标头时,会发生此错误。检查资源的身份验证方法,并验证客户端使用的身份验证方法。
身份验证方法不同时会发生错误。要确定客户端使用的身份验证类型,请检查客户端的身份验证设置。


  < p>< a href =" 查看"> http:// go.microsoft.com/fwlink/?LinkID=62293&amp;IIS70Error=401,2,0x80070005,7600">View 更多信息& raquo;< / a>< / p>


  < p> Microsoft知识库文章:< / p>

 < ul>< li> 907273< / li>< li> 253667< / li>< / ul>


 

 < / fieldset>

< / div>

< / div>

< / body>

< / html>

解决方案

您是否尝试过按照此处的步骤操作?


http:// msdn。 microsoft.com/en-us/library/gg299070(v=sql.110).aspx


I have installed the Sysnc Framework Toolkit and configured the samples ListService project as per help file (.chm).

This works, but after trying the option "Use Local Web Server" from withIn project properties in VS2010 (first pressing "create virtual directory"), it then doesn't work and I get the following error:

synchronisation failed: system.security.SecurityException-->.....

......................internalendgetresponse(IAsyncResult asyncResult)

If I then change back to "Use Visual Studio Development Server" all works again.

I notice that if I click debug-->exceptions-->clrexceptions-->thrown, it fails at:

HttpCacheRequestHandler.OnDownloadGetResponseCompleted,  Stating that:

AsyncWaitHandle = 'asyncResult.AsyncWaitHandle' threw an exception of type 'System.NotSupportedException'

base {System.SystemException} = {System.NotSupportedException: Specified method is not supported.
   at System.Net.Browser.BHWRAsyncResult.get_AsyncWaitHandle()}

I am using windows 7 pc, with VS2010 SP1

Also if helps my diag$ is all fine when run under VS2010 web server, but when show for IIS it says:

ClientAccessPolicy.xml/CrossDomain.xml files FAILED                   Could not find clientaccesspolicy.xml or crossdomain.xml file. Silverlight clients invoking the service from another domain will                  be unable to make requests successfully.                 

running in fiddler i can see the following details for clientaccesspolicy files:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>IIS 7.5 Detailed Error - 401.2 - Unauthorized</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;background:#CBE1EF;}
code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;}
.config_source code{font-size:.8em;color:#000000;}
pre{margin:0;font-size:1.4em;word-wrap:break-word;}
ul,ol{margin:10px 0 10px 40px;}
ul.first,ol.first{margin-}
fieldset{padding:0 15px 10px 15px;}
.summary-container fieldset{padding-bottom:5px;margin-}
legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;}
legend{color:#333333;padding:4px 15px 4px 10px;margin:4px 0 8px -12px;_margin-
 border-border-border-right:1px solid #969696;
 border-bottom:1px solid #969696;background:#E7ECF0;font-weight:bold;font-size:1em;}
a:link,a:visited{color:#007EFF;font-weight:bold;}
a:hover{text-decoration:none;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.4em;margin:10px 0 0 0;color:#CC0000;}
h4{font-size:1.2em;margin:10px 0 5px 0;
}#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS",Verdana,sans-serif;
 color:#FFF;background-color:#5C87B2;
}#content{margin:0 0 0 2%;}
.summary-container,.content-container{background:#FFF;width:96%;margin-padding:10px;}
.config_source{background:#fff5c4;}
.content-container p{margin:0 0 10px 0;
}#details-left{width:35%;float:left;margin-right:2%;
}#details-right{width:63%;float:left;
}#server_version{width:96%;_height:1px;min-height:1px;margin:0 0 5px 0;padding:11px 2% 8px 2%;color:#FFFFFF;
 background-color:#5A7FA5;border-bottom:1px solid #C1CFDD;border-font-weight:normal;
 font-size:1em;color:#FFF;text-align:right;
}#server_version p{margin:5px 0;}
table{margin:4px 0 4px 0;width:100%;border:none;}
td,th{vertical-align:top;padding:3px 0;text-align:left;font-weight:bold;border:none;}
th{width:30%;text-align:right;padding-right:2%;font-weight:normal;}
thead th{background-color:#ebebeb;width:25%;
}#details-right th{width:20%;}
table tr.alt td,table tr.alt th{background-color:#ebebeb;}
.highlight-code{color:#CC0000;font-weight:bold;font-style:italic;}
.clear{clear:both;}
.preferred{padding:0 5px 2px 5px;font-weight:normal;background:#006633;color:#FFF;font-size:.8em;}
-->
</style>
 
</head>
<body>
<div id="header"><h1>Server Error in Application "DEFAULT WEB SITE"</h1></div>
<div id="server_version"><p>Internet Information Services 7.5</p></div>
<div id="content">
<div class="content-container">
 <fieldset><legend>Error Summary</legend>
  <h2>HTTP Error 401.2 - Unauthorized</h2>
  <h3>You are not authorized to view this page due to invalid authentication headers.</h3>
 </fieldset>
</div>
<div class="content-container">
 <fieldset><legend>Detailed Error Information</legend>
  <div id="details-left">
   <table border="0" cellpadding="0" cellspacing="0">
    <tr class="alt"><th>Module</th><td>IIS Web Core</td></tr>
    <tr><th>Notification</th><td>AuthenticateRequest</td></tr>
    <tr class="alt"><th>Handler</th><td>StaticFile</td></tr>
    <tr><th>Error Code</th><td>0x80070005</td></tr>
    
   </table>
  </div>
  <div id="details-right">
   <table border="0" cellpadding="0" cellspacing="0">
    <tr class="alt"><th>Requested URL</th><td>http://localhost:80/crossdomain.xml</td></tr>
    <tr><th>Physical Path</th><td>C:\inetpub\wwwroot\crossdomain.xml</td></tr>
    <tr class="alt"><th>Logon Method</th><td>Not yet determined</td></tr>
    <tr><th>Logon User</th><td>Not yet determined</td></tr>
    
   </table>
   <div class="clear"></div>
  </div>
 </fieldset>
</div>
<div class="content-container">
 <fieldset><legend>Most likely causes:</legend>
  <ul>  <li>No authentication protocol (including anonymous) is selected in IIS.</li>  <li>Only integrated authentication is enabled, and a client browser was used that does not support integrated authentication.</li>  <li>Integrated authentication is enabled and the request was sent through a proxy that changed the authentication headers before they reach the Web server.</li>  <li>The Web server is not configured for anonymous access and a required authorization header was not received.</li>  <li>The "configuration/system.webServer/authorization" configuration section may be explicitly denying the user access.</li> </ul>
 </fieldset>
</div>
<div class="content-container">
 <fieldset><legend>Things you can try:</legend>
  <ul>  <li>Verify the authentication setting for the resource and then try requesting the resource using that authentication method.</li>  <li>Verify that the client browser supports Integrated authentication.</li>  <li>Verify that the request is not going through a proxy when Integrated authentication is used.</li>  <li>Verify that the user is not explicitly denied access in the "configuration/system.webServer/authorization" configuration section.</li>  <li>Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click <a href="herehttp://go.microsoft.com/fwlink/?LinkID=66439">here</a>. </li> </ul>
 </fieldset>
</div>
 
 
<div class="content-container">
 <fieldset><legend>Links and More Information</legend>
  This error occurs when the WWW-Authenticate header sent to the Web server is not supported by the server configuration. Check the authentication method for the resource, and verify which authentication method the client used. The error occurs when the authentication methods are different. To determine which type of authentication the client is using, check the authentication settings for the client.
  <p><a href="View">http://go.microsoft.com/fwlink/?LinkID=62293&amp;IIS70Error=401,2,0x80070005,7600">View more information &raquo;</a></p>
  <p>Microsoft Knowledge Base Articles:</p>
 <ul><li>907273</li><li>253667</li></ul>
 
 </fieldset>
</div>
</div>
</body>
</html>

解决方案

have you tried following the steps here?

http://msdn.microsoft.com/en-us/library/gg299070(v=sql.110).aspx


这篇关于在IIS下运行时使用Sync Framework工具包的安全异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆