“参数:未找到”使用 Silverlight 的 Windows 身份验证时出错

发布于 2024-10-01 03:50:16 字数 8050 浏览 0 评论 0原文

使用 SL 业务应用程序模板创建的 SL 应用程序。然后将其配置为在 web.Config 中使用 Windows 身份验证:

<authentication mode="Windows">     
</authentication>

App.xaml.cs 中的代码将身份验证初始化为:

 webContext.Authentication = new WindowsAuthentication() 
     { DomainContext = new MyRIAServices.Web.AuthenticationContext() };

然后将此应用程序移至 IIS 并将 IIS 下的网站设置为 Widnows 身份验证。 然后运行这个应用程序,就可以了,它可以获取域帐户(登录Windows的AD帐户)。

然后将此应用程序移至同一域中的另一台 Windows 2008 R2 计算机。 IIS 下的网站配置与 Windows 7 上完全相同。然后访问 sl 应用程序并收到以下错误:

Load operation failed for query 'GetUser'.
[HttpWebRequest_WebException_RemoteServer]
Argument: NotFound
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem.
See http://go.microsoft.com/fwlink/?linkid=106663&version=4.0.50917&File=System.Windows.dll&key=httpWebRequest_WebException_RemoteServer

在System.ServiceModel.DomainServices.Client.OperationBase.Complete(异常错误) 在 System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.End(IAsyncResult 结果) 在 System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.<>c_DisplayClass1.b_0(对象状态) 在 System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.RunInSynchronizationContext(SendOrPostCallback 回调,对象状态) 在 System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.HandleAsyncCompleted(IAsyncResult asyncResult) 在 System.ServiceModel.DomainServices.Client.AsyncResultBase.Complete() 在 System.ServiceModel.DomainServices.Client.ApplicationServices.WebAuthenticationService.HandleOperationComplete(OperationBase 操作) 在 System.ServiceModel.DomainServices.Client.LoadOperation.<>c_DisplayClass41.b__0(LoadOperation1 arg) 在 System.ServiceModel.DomainServices.Client.LoadOperation`1.InvokeCompleteAction() 在System.ServiceModel.DomainServices.Client.OperationBase.Complete(异常错误) 在System.ServiceModel.DomainServices.Client.LoadOperation.Complete(异常错误) 在 System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult) 在 System.ServiceModel.DomainServices.Client.DomainContext.<>c_DisplayClass1b.b__17(Object ) 原因:查询“GetUser”的加载操作失败。 [HttpWebRequest_WebException_RemoteServer] 参数:未找到 调试资源字符串不可用。通常,键和参数提供了足够的信息来诊断问题。请参阅 http: //go.microsoft.com/fwlink/?linkid=106663&Version=4.0.50917.0&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer

在System.ServiceModel.DomainServices.Client.OperationBase.Complete(异常错误) 在 System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.End(IAsyncResult 结果) 在 System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.<>c_DisplayClass1.b_0(对象状态) 在 System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.RunInSynchronizationContext(SendOrPostCallback 回调,对象状态) 在 System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.HandleAsyncCompleted(IAsyncResult asyncResult) 在 System.ServiceModel.DomainServices.Client.AsyncResultBase.Complete() 在 System.ServiceModel.DomainServices.Client.ApplicationServices.WebAuthenticationService.HandleOperationComplete(OperationBase 操作) 在 System.ServiceModel.DomainServices.Client.LoadOperation.<>c_DisplayClass41.b__0(LoadOperation1 arg) 在 System.ServiceModel.DomainServices.Client.LoadOperation`1.InvokeCompleteAction() 在System.ServiceModel.DomainServices.Client.OperationBase.Complete(异常错误) 在System.ServiceModel.DomainServices.Client.LoadOperation.Complete(异常错误) 在 System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult) 在 System.ServiceModel.DomainServices.Client.DomainContext.<>c_DisplayClass1b.b__17(Object ) 原因:查询“GetUser”的加载操作失败。 [HttpWebRequest_WebException_RemoteServer] 参数:未找到 调试资源字符串不可用。通常,键和参数提供了足够的信息来诊断问题。请参阅 http: //go.microsoft.com/fwlink/?linkid=106663&Version=4.0.50917.0&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer

在System.ServiceModel.DomainServices.Client.OperationBase.Complete(异常错误) 在 System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.End(IAsyncResult 结果) 在 System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.<>c_DisplayClass1.b_0(对象状态) 在 System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.RunInSynchronizationContext(SendOrPostCallback 回调,对象状态) 在 System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.HandleAsyncCompleted(IAsyncResult asyncResult) 在 System.ServiceModel.DomainServices.Client.AsyncResultBase.Complete() 在 System.ServiceModel.DomainServices.Client.ApplicationServices.WebAuthenticationService.HandleOperationComplete(OperationBase 操作) 在 System.ServiceModel.DomainServices.Client.LoadOperation.<>c_DisplayClass41.b__0(LoadOperation1 arg) 在 System.ServiceModel.DomainServices.Client.LoadOperation`1.InvokeCompleteAction() 在System.ServiceModel.DomainServices.Client.OperationBase.Complete(异常错误) 在System.ServiceModel.DomainServices.Client.LoadOperation.Complete(异常错误) 在 System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult) 在 System.ServiceModel.DomainServices.Client.DomainContext.<>c_DisplayClass1b.b__17(Object ) 原因:查询“GetUser”的加载操作失败。 [HttpWebRequest_WebException_RemoteServer] 参数:未找到 调试资源字符串不可用。通常,键和参数提供了足够的信息来诊断问题。请参阅 http: //go.microsoft.com/fwlink/?linkid=106663&Version=4.0.50917.0&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer

在System.ServiceModel.DomainServices.Client.OperationBase.Complete(异常错误) 在 System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.End(IAsyncResult 结果) 在 System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.<>c_DisplayClass1.b_0(对象状态) 在 System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.RunInSynchronizationContext(SendOrPostCallback 回调,对象状态) 在 System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.HandleAsyncCompleted(IAsyncResult asyncResult) 在 System.ServiceModel.DomainServices.Client.AsyncResultBase.Complete() 在 System.ServiceModel.DomainServices.Client.ApplicationServices.WebAuthenticationService.HandleOperationComplete(OperationBase 操作) 在 System.ServiceModel.DomainServices.Client.LoadOperation.<>c_DisplayClass41.b__0(LoadOperation1 arg) 在 System.ServiceModel.DomainServices.Client.LoadOperation`1.InvokeCompleteAction() 在System.ServiceModel.DomainServices.Client.OperationBase.Complete(异常错误) 在System.ServiceModel.DomainServices.Client.LoadOperation.Complete(异常错误) 在 System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult) 在 System.ServiceModel.DomainServices.Client.DomainContext.<>c_DisplayClass1b.b__17(Object )

如何解决此问题?

A SL app created with SL Business Application template. Then Config it use Windows Authentication in web.Config as:

<authentication mode="Windows">     
</authentication>

Code in App.xaml.cs to initialize authentication as:

 webContext.Authentication = new WindowsAuthentication() 
     { DomainContext = new MyRIAServices.Web.AuthenticationContext() };

then move this app to IIS and set website under IIS as Widnows Authentication.
Then Run this app, it is fine, It can get domain account (AD acount logged into windows).

Then move this app to anohter computer Windows 2008 R2 in the same domain. website under IIS configed exactly same as on windows 7. then access the sl app and got following error:

Load operation failed for query 'GetUser'.
[HttpWebRequest_WebException_RemoteServer]
Argument: NotFound
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem.
See http://go.microsoft.com/fwlink/?linkid=106663&version=4.0.50917&File=System.Windows.dll&key=httpWebRequest_WebException_RemoteServer

at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.End(IAsyncResult result)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.<>c_DisplayClass1.b_0(Object state)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.RunInSynchronizationContext(SendOrPostCallback callback, Object state)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.HandleAsyncCompleted(IAsyncResult asyncResult)
at System.ServiceModel.DomainServices.Client.AsyncResultBase.Complete()
at System.ServiceModel.DomainServices.Client.ApplicationServices.WebAuthenticationService.HandleOperationComplete(OperationBase operation)
at System.ServiceModel.DomainServices.Client.LoadOperation.<>c_DisplayClass41.<Create>b__0(LoadOperation1 arg)
at System.ServiceModel.DomainServices.Client.LoadOperation`1.InvokeCompleteAction()
at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.LoadOperation.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult)
at System.ServiceModel.DomainServices.Client.DomainContext.<>c
_DisplayClass1b.b__17(Object )
Caused by: Load operation failed for query 'GetUser'. [HttpWebRequest_WebException_RemoteServer]
Arguments: NotFound
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=4.0.50917.0&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer

at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.End(IAsyncResult result)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.<>c_DisplayClass1.b_0(Object state)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.RunInSynchronizationContext(SendOrPostCallback callback, Object state)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.HandleAsyncCompleted(IAsyncResult asyncResult)
at System.ServiceModel.DomainServices.Client.AsyncResultBase.Complete()
at System.ServiceModel.DomainServices.Client.ApplicationServices.WebAuthenticationService.HandleOperationComplete(OperationBase operation)
at System.ServiceModel.DomainServices.Client.LoadOperation.<>c_DisplayClass41.<Create>b__0(LoadOperation1 arg)
at System.ServiceModel.DomainServices.Client.LoadOperation`1.InvokeCompleteAction()
at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.LoadOperation.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult)
at System.ServiceModel.DomainServices.Client.DomainContext.<>c
_DisplayClass1b.b__17(Object )
Caused by: Load operation failed for query 'GetUser'. [HttpWebRequest_WebException_RemoteServer]
Arguments: NotFound
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=4.0.50917.0&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer

at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.End(IAsyncResult result)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.<>c_DisplayClass1.b_0(Object state)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.RunInSynchronizationContext(SendOrPostCallback callback, Object state)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.HandleAsyncCompleted(IAsyncResult asyncResult)
at System.ServiceModel.DomainServices.Client.AsyncResultBase.Complete()
at System.ServiceModel.DomainServices.Client.ApplicationServices.WebAuthenticationService.HandleOperationComplete(OperationBase operation)
at System.ServiceModel.DomainServices.Client.LoadOperation.<>c_DisplayClass41.<Create>b__0(LoadOperation1 arg)
at System.ServiceModel.DomainServices.Client.LoadOperation`1.InvokeCompleteAction()
at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.LoadOperation.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult)
at System.ServiceModel.DomainServices.Client.DomainContext.<>c
_DisplayClass1b.b__17(Object )
Caused by: Load operation failed for query 'GetUser'. [HttpWebRequest_WebException_RemoteServer]
Arguments: NotFound
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=4.0.50917.0&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer

at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.End(IAsyncResult result)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.<>c_DisplayClass1.b_0(Object state)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.RunInSynchronizationContext(SendOrPostCallback callback, Object state)
at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.HandleAsyncCompleted(IAsyncResult asyncResult)
at System.ServiceModel.DomainServices.Client.AsyncResultBase.Complete()
at System.ServiceModel.DomainServices.Client.ApplicationServices.WebAuthenticationService.HandleOperationComplete(OperationBase operation)
at System.ServiceModel.DomainServices.Client.LoadOperation.<>c_DisplayClass41.<Create>b__0(LoadOperation1 arg)
at System.ServiceModel.DomainServices.Client.LoadOperation`1.InvokeCompleteAction()
at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.LoadOperation.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult)
at System.ServiceModel.DomainServices.Client.DomainContext.<>c
_DisplayClass1b.b__17(Object )

How to fix this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧竹 2024-10-08 03:50:16

使用 WCF RIA 服务部署 Silverlight 4 应用程序确实是一场噩梦!但这是解决方案!

为 Silverlight 4 和 WCF RIA 服务设置服务器(例如 MS Windows Server 2008 R2、IIS7):

1) 下载并安装 .NET 4 Framework Web 平台安装程序。
使用安装程序安装 .NET 4 Framework。完成后重新启动服务器。

2) 将 WCF RIA 服务下载到本地计算机(例如 c:\temp)。
打开命令窗口(我使用“以管理员身份运行”)。转到包含 MSI 文件的文件夹(例如 c:\temp)并
键入以下命令启动 WCF RIA 服务的安装:

msiexec /i RiaServices.msi SERVER=TRUE

3) 要删除恼人的错误 [HttpWebRequest_WebException_RemoteServer],请执行以下操作:
转到命令提示符,打开 Microsoft.NET\Framework64 文件夹
(例如 C:\Windows\Microsoft.NET\Framework64\v4.0.30319)并执行以下命令:

servicemodelreg -ia
aspnet_regiis -i
iisreset

这将纠正安装问题,并且 WCF RIA 服务按预期工作。

此致,

Matjaz Bravc,MCPD

Deploying Silverlight 4 applications with WCF RIA Services can be really a nightmare! But here is solution!

Setup your server (e.g. MS Windows Server 2008 R2, IIS7) for Silverlight 4 and WCF RIA Services:

1) Download and install the .NET 4 Framework Web Platform Installer.
Use the installer to install the .NET 4 Framework. Reboot the server after this completes.

2) Download WCF RIA Services to your local machine (e.g. c:\temp).
Open up a command window (I used "Run as Administrator"). Go to the folder with the MSI file (e.g. c:\temp) and
type the following command to launch the install of WCF RIA Services:

msiexec /i RiaServices.msi SERVER=TRUE

3) To remove anoying error [HttpWebRequest_WebException_RemoteServer] do the following:
go to the command prompt, open the Microsoft.NET\Framework64 folder
(e.g. C:\Windows\Microsoft.NET\Framework64\v4.0.30319) and execute the following commands:

servicemodelreg -ia
aspnet_regiis -i
iisreset

This corrects the installation issue and WCF RIA Services works as expected.

Regards,

Matjaz Bravc, MCPD

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文