我怎样才能摆脱"靶组件不包括服务类型和QUOT;在VS2008的错误信息? [英] How can I get rid of the "The target assembly contains no service types" error message in VS2008?

查看:682
本文介绍了我怎样才能摆脱"靶组件不包括服务类型和QUOT;在VS2008的错误信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个客户机/服务器WCF应用程序

I've got a Client/Server wcf application

我的可执行文件并没有定义任何的ServiceContract ,它甚至没有提及 System.ServiceModel ,而是引用了其中包含的逻辑连接到服务器的程序集的)

My executable doesn't define any ServiceContract, it doesn't even have a reference to System.ServiceModel (but instead has a reference to an assembly which contains the connection logic to the server)

我有另一个程序,这是我的EXE,其中包含引用的的ServiceContract

I've another assembly, which is referenced by my EXE, which contains a ServiceContract.

它用来做工精细。昨天,我已经打了很多与我的项目设置(部分信任,完全信任,部署设置,等等的),现在,每一次我启动我的客户,我已经得到了下面的消息框:

It used to work fine. Yesterday, I've played a lot with my project settings (partial trust, full trust, deployment settings, and so on) and now, each and every time I launch my client, I've got the following message box :

微软WCF服务主机
   目标程序集包含没有服务类型。
   您可能需要调整该组件的code访问安全策略。

Microsoft WCF Service Host
The target assembly contains no service types.
You may need to adjust the Code Access Security policy of this assembly.

然后VS冻结1分钟,并最终让我调试我的计划照常进行。

Then VS freezes for 1 minute, and eventually lets me debug my program as usual.

我发现<一href="http://cs.rthand.com/blogs/blog_with_righthand/archive/2008/03/10/_2200_The-target-assembly-contains-no-service-types.--You-may-need-to-adjust-the-$c$c-Access-Security-policy-of-this-assembly_2E002200_-annoyance.aspx">a张贴在这一问题,但解决方案并不在我的情况适用。 有任何想法吗?

I've found a post on this problem, but the solution doesn't apply in my situation. Any ideas?

推荐答案

它总是这样。您搜索的2个小时,你最终落得SO张贴,并5分钟以后,你找到答案。

It's always like that. You search for 2 hours, you eventually end up posting on SO, and 5minutes later, you find the answer.

项目的属性定义<$ C $ WCF选项卡C>的ServiceContract , 有标记,我未选中调试在同一个解决方案的另一个项目时,开始WCF服务主机复选框。

In the WCF Options tab of the properties of the project defining the ServiceContract, there's a checkbox labelled "Start WCF Service Host when debugging another project in the same solution" that I unchecked.

我不知道它是怎样被摆在首位检查。

I've no idea how it has been checked in the first place.

无论如何,这解决了我的问题。请参阅 MSDN参考为这个项目设定。

Anyway, that solved my problem. See the MSDN Reference for this project setting.

这篇关于我怎样才能摆脱&QUOT;靶组件不包括服务类型和QUOT;在VS2008的错误信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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