Click here to Skip to main content
15,904,023 members
Home / Discussions / C#
   

C#

 
GeneralADO.NET.... Pin
Isaac Gordon30-Jun-09 0:29
Isaac Gordon30-Jun-09 0:29 
GeneralRe: ADO.NET.... Pin
Pete O'Hanlon30-Jun-09 0:41
mvePete O'Hanlon30-Jun-09 0:41 
GeneralRe: ADO.NET.... Pin
Manas Bhardwaj30-Jun-09 0:44
professionalManas Bhardwaj30-Jun-09 0:44 
GeneralRe: ADO.NET.... Pin
Svetlin Panayotov30-Jun-09 0:50
Svetlin Panayotov30-Jun-09 0:50 
GeneralRe: ADO.NET.... Pin
Vimalsoft(Pty) Ltd30-Jun-09 1:41
professionalVimalsoft(Pty) Ltd30-Jun-09 1:41 
GeneralRe: ADO.NET.... Pin
dan!sh 30-Jun-09 1:51
professional dan!sh 30-Jun-09 1:51 
GeneralRe: ADO.NET.... Pin
PIEBALDconsult30-Jun-09 19:02
mvePIEBALDconsult30-Jun-09 19:02 
QuestionHow to change Web Service url dynamically when it's referenced in a class library (dll) ? Pin
shaul-y29-Jun-09 23:56
shaul-y29-Jun-09 23:56 
Hi Guys,

My .net 3.5 solution contains a wpf application and a class library project (dll).
The dll is referenced (add reference --> projects tab) by the wpf app.
I added a web reference to the class library and configured its "URL Behavior" to dynamic,
so that when I deploy the application I could replace the WS's url in the app setting.

An app.config file was automatically generated in the class library project, containing the settings for the project:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="MyDll.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        </sectionGroup>
    </configSections>
    <system.serviceModel>
        <bindings />
        <client />
    </system.serviceModel>
    <applicationSettings>
        <MyDll.Properties.Settings>
            <setting name="MyDll_MyServices_DataService"
                serializeAs="String">
                <value>http://localhost/MyServices/DataService.asmx</value>
            </setting>
        </MyDll.Properties.Settings>
    </applicationSettings>
</configuration>


When I build the solution, only the wpf.exe.config file is created - the dll.config
file is not copied to the output directory.
I thought maybe the settings were merged but the wpf.exe.config file doesn't contain
the above settings from the class library app.config.

Bottom line - If the dll config file is not copied / merged to the exe config, I can't change the url of the WS!
The code in the class library will always use the default values since it won't find it in and application setting.

I know I can manually copy the dll's settings section from its app.config file
to the WPF's app.config file, but this sounds like a bad idea.

What is the right way to complete my goal?

Thanks,
Shaul
AnswerRe: How to change Web Service url dynamically when it's referenced in a class library (dll) ? Pin
Pete O'Hanlon30-Jun-09 0:35
mvePete O'Hanlon30-Jun-09 0:35 
GeneralThanks but this solution is not relevant for my scenario... Pin
shaul-y30-Jun-09 1:12
shaul-y30-Jun-09 1:12 
GeneralRe: Thanks but this solution is not relevant for my scenario... Pin
Pete O'Hanlon30-Jun-09 1:17
mvePete O'Hanlon30-Jun-09 1:17 
GeneralRe: Thanks but this solution is not relevant for my scenario... Pin
shaul-y30-Jun-09 3:08
shaul-y30-Jun-09 3:08 
Questionis there anyway to know default icon or user specified icon showing in the form currently Pin
mutpan29-Jun-09 23:42
mutpan29-Jun-09 23:42 
AnswerRe: is there anyway to know default icon or user specified icon showing in the form currently Pin
stancrm29-Jun-09 23:56
stancrm29-Jun-09 23:56 
GeneralRe: is there anyway to know default icon or user specified icon showing in the form currently Pin
mutpan30-Jun-09 1:35
mutpan30-Jun-09 1:35 
Questioncontrol winforms application from remote computer Pin
Jan198229-Jun-09 23:38
Jan198229-Jun-09 23:38 
AnswerRe: control winforms application from remote computer Pin
Christian Graus30-Jun-09 0:23
protectorChristian Graus30-Jun-09 0:23 
AnswerRe: control winforms application from remote computer Pin
musefan30-Jun-09 2:12
musefan30-Jun-09 2:12 
QuestionVideo Processing - ColorMatrix Pin
tvbarnard29-Jun-09 23:19
tvbarnard29-Jun-09 23:19 
AnswerRe: Video Processing - ColorMatrix Pin
Christian Graus30-Jun-09 0:20
protectorChristian Graus30-Jun-09 0:20 
GeneralRe: Video Processing - ColorMatrix Pin
tvbarnard30-Jun-09 1:03
tvbarnard30-Jun-09 1:03 
GeneralRe: Video Processing - ColorMatrix Pin
musefan30-Jun-09 2:08
musefan30-Jun-09 2:08 
GeneralRe: Video Processing - ColorMatrix Pin
tvbarnard30-Jun-09 2:21
tvbarnard30-Jun-09 2:21 
GeneralRe: Video Processing - ColorMatrix Pin
musefan30-Jun-09 2:29
musefan30-Jun-09 2:29 
GeneralRe: Video Processing - ColorMatrix Pin
tvbarnard30-Jun-09 2:34
tvbarnard30-Jun-09 2:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.