开发者

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

开发者 https://www.devze.com 2023-03-28 05:15 出处:网络
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 a

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

精彩评论

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