带有 WCF 的 Silverlight 业务应用程序模板发出警告 [英] Silverlight Business Application template with WCF is throwing warning

查看:29
本文介绍了带有 WCF 的 Silverlight 业务应用程序模板发出警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Silvelight 业务应用程序模板.我写了一个函数,它使用 Membership.getUserList 函数返回用户列表.我尝试使用 WCF 将其公开为服务.但是当我尝试编译客户端代码时,它会抛出一个警告,提示user_authentication.Web.Service1 的客户端代理生成失败".为什么会发生?完整的警告信息是:

I am using the Silvelight Business Application template. I wrote a function which uses Membership.getUserList function to return the user list. I tried exposing it as Service using WCF. But when I try to compile the client side code it throws a warning saying "Client Proxy Generation for user_authentication.Web.Service1 failed'. Why does it happen? The complete warning message is:

警告 4 客户端代理生成服务'user_authentication.Web.Service1'失败:正在生成元数据文件...警告:无法加载服务配置名称'user_authentication.Web.Service1'.到出口服务同时提供包含服务类型的程序集和一个带有配置的可执行文件对于这项服务.详细信息:通过的程序集都不是可执行文件带有配置文件或没有包含的配置文件具有配置名称的服务'user_authentication.Web.Service1'.

Warning 4 Client proxy generation for service 'user_authentication.Web.Service1' failed: Generating metadata files... Warning: Unable to load a service with configName 'user_authentication.Web.Service1'. To export a service provide both the assembly containing the service type and an executable with configuration for this service. Details:Either none of the assemblies passed were executables with configuration files or none of the configuration files contained services with the config name 'user_authentication.Web.Service1'.

警告:没有元数据文件生成.没有服务合同出口.要导出服务,请使用/serviceName 选项.出口数据合同,指定/dataContractOnly 选项.这个可以有时发生在某些安全上下文,例如当程序集通过 UNC 网络文件共享加载.如果是这种情况,请尝试复制组装到受信任的环境中并运行它.

Warning: No metadata files were generated. No service contracts were exported. To export a service, use the /serviceName option. To export data contracts, specify the /dataContractOnly option. This can sometimes occur in certain security contexts, such as when the assembly is loaded over a UNC network file share. If this is the case, try copying the assembly into a trusted environment and running it.

推荐答案

很难说,我还不是一个足够好的透视者 ;-) ... 你的网络服务实际上已经编译、发布和运行了吗?也许在这里您可以找到更多提示:

Hard to say, I'm not a good enough clairvoyant yet ;-) ... Is your webservice actually already compiled, published and running? Maybe here you can find further hints:

MSDN WCF 论坛:svcutil 错误

这篇关于带有 WCF 的 Silverlight 业务应用程序模板发出警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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