Initialise BasicHttpBinding object from file other than app.config?

kikezelpbek

New Member
I currently have code (in C#) that requires a BasicHttpBinding object to connect to SSRS. As it stands, I initilise this object using values assigned in code, rather than reading it from the app.config (this is because the platform I'm deploying to, MS CRM 2011, does not provide access to the app.config file for reading. In fact, I don't think the app.config file even gets copied to the server?). I'd like to make this binding editable without recompiling so the solution can be installed easily at different customers. The cleanest way I can think of is to have the binding config stored in a webresource (for non-CRM people, this is just a name for a file stored inside CRM that you can access from code), but I'm not sure of the best way to parse that config into a BasicHttpBinding object? Manually parsing it and setting the properties seems inefficient and not very robust. Is there any way of getting .Net to to it for me (similar to the BasicHttpBinding(String) constructor, but since I don't have access to app.config this isn't an option)?P.S. I've asked a similar question in the MS forums, but I've received no answer, and from browsing this forum regularly I thought I would likely be exposed to a wider audience here (therefore making it more likely someone may be able to answer my question). If this is considered bad manners, I apologise.ThanksJames
 
Back
Top