views:

1483

answers:

1

I've got a Client/Server wcf application

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)

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 :

Microsoft WCF Service Host

The target assembly contains no service types.

You may need to adjust the Code Access Security policy of this assembly.

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

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

+7  A: 

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

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.

Anyway, that solved my problem.

Brann
sorry, quickly skimmed through and missed the link! I think the posting and solving it 5 mins later thing happens becuase you think through the problem and retrace your steps when you post and pick up things you perhaps didn't think of before. Anyhow, glad it's sorted
Tanner
No problem ! In my case, I've found complicated workarounds in google, so I didn't think a "just uncheck that checkbox" solution existed !
Brann