|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SettingsProvider issue [VB.NET 2005]I have a class that inherits from SettingsProvider to allow my application
to do some special processing that is needed on some of the settings. The class, "VMSettingsProvider", is in a class library in a namespace "VM". My class provides all the required methods as described in the documentation and it compiles correctly. To test this I have added a setting using the designer for the application and set the provider to "VM.VMSettingsProvider", again the code generated by the designer compiles just fine. The problem is that when I start my application and the "Initialize" method of my class is called it has "nothing" as the application name passed to it, when the base class "Initialize" is called an exception (Invalid Operation - the Value can not be null) occurs. Do I need to do more than the steps I have described for this to work? Any pointers to the correct approach would be much appreciated. Sid. I have found a work-around for this issue, although I am not sure why it is
necessary. The "Initialize" method I wrote looked like this: Public Overrides Sub Initialize(ByVal name As String, ByVal config As System.Collections.Specialized.NameValueCollection) MyBase.Initialize(name , config) End Sub When I changed it to: Public Overrides Sub Initialize(ByVal name As String, ByVal config As System.Collections.Specialized.NameValueCollection) MyBase.Initialize(Me.ApplicationName, config) End Sub the exception went away and the class library now works. Why is this required? I would have expected the passed "name" parameter to contain the application name. Sid. Show quoteHide quote "Sid Price" <s**@nowhere.com> wrote in message news:ev9UCZiMIHA.5300@TK2MSFTNGP04.phx.gbl... >I have a class that inherits from SettingsProvider to allow my application >to do some special processing that is needed on some of the settings. The >class, "VMSettingsProvider", is in a class library in a namespace "VM". > My class provides all the required methods as described in the > documentation and it compiles correctly. > To test this I have added a setting using the designer for the application > and set the provider to "VM.VMSettingsProvider", again the code generated > by the designer compiles just fine. > The problem is that when I start my application and the "Initialize" > method of my class is called it has "nothing" as the application name > passed to it, when the base class "Initialize" is called an exception > (Invalid Operation - the Value can not be null) occurs. > Do I need to do more than the steps I have described for this to work? Any > pointers to the correct approach would be much appreciated. > Sid. > >
Multiple Stored Procedure Calls within single transaction
Simple Pulbic Variable Exclude code of my application Vb.Net/SQL slowdown VB.NET desktop equivalent to asp.net stylesheets Setting SelectedItem of ComboBox programatically not working How does a project find dlls that it uses - where do I put them? Num records returned from query Multi language tooltips in Windows forms CausesValidation |
|||||||||||||||||||||||