开发者

Is there a simple way to add a service reference to one assembly but keep the client config in another?

I'm aware of the drawbacks of simply adding WCF service references (later I intend to create client proxies another way), but for开发者_JS百科 now I need to add a service reference to a Silverlight assembly but the config to the main UI assembly so that it will be packaged into the .xap file. Is there an easy way to do this?


vorrtex in the comments turns out to be right. I lost sight of that solution after a bit of experimentation. I had also forgotten to mention that I was using the xml transformation tasks in the .csproj file.

My final solution is this:

  1. In Silverlight service client assembly, add WCF references as usual.
  2. Add a ServicesReferences.Configuration.ClientConfig for each build configuration
  3. Add before/after build transform targets in the .csproj
  4. Add as Link in the main Silverlight UI assembly.
  5. Build. The Silverlight Web assembly creates the .xap for that configuration with the right ServiceReferences.ClientConfig file.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜