By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,558 Members | 1,607 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,558 IT Pros & Developers. It's quick & easy.

VS2005 - Changes to configuration sections between beta 2 and rele

P: n/a
I have an application with custom configuration sections in it's app.config
file.

Here's a shortened excerpt:

<monitors>
<monitor
type="SystemMonitor.Monitors.NetworkAvailabilityMo nitor,SystemMonitor">
<notifiers>
<notifier type="SystemMonitor.Notifiers.MessageBoxNotifier,S ystemMonitor" />
<notifier type="SystemMonitor.Notifiers.EventLogNotifier,Sys temMonitor">
</notifier>
</notifiers>
</monitor>
</monitors>

here's some code from the application. Note again shortened, this is only
the section defining a "monitor" section above:

mports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Configuration

Namespace Configuration
Class MonitorElement
Inherits ConfigurationElement

<ConfigurationProperty("type")> _
Public Property TypeName() As String
Get
Return CStr(MyBase.Item("type"))
End Get
Set(ByVal value As String)
MyBase.Item("type") = value
End Set
End Property

<ConfigurationProperty("settings", IsDefaultCollection:=False)> _
Public ReadOnly Property Settings() As SettingElementCollection
Get
Return CType(MyBase.Item("settings"),
SettingElementCollection)
End Get
End Property

<ConfigurationProperty("notifiers", IsDefaultCollection:=False)> _
Public ReadOnly Property Notifiers() As NotifierElementCollection
Get
Return CType(MyBase.Item("notifiers"),
NotifierElementCollection)
End Get
End Property
End Class
End Namespace

Under VS2005 Beta2, this worked just fine. However, now i have recompiled
using VS2005 RTM and am getting an error on the line that says:

<monitor type=.....

Specifically the error is that "type" is not defined.

So obviously something was changed but I am having trouble determing what
was changed so i can fix the code in question.

Thanks in advance,
Robert.
Oct 30 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi Robert,

Welcome to MSDN newsgroup.

From your description, you've implement some custom configuration section
handlers, elements /elementcollections through the .NET 2.0 configuration
model. However, the code broke when move from beta2 to the RTM
environment,yes?

Based on the code snippet you provided, it seems that the problem is
concerned to the element within a collection Element, have you tried move
that problem element out of collection and test it directly under the
Section element to see whether it also cause the same error?

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Thread-Topic: VS2005 - Changes to configuration sections between beta 2
and rele
| thread-index: AcXc5bidBXvi9xouRk6wjOqqLCrwKw==
| X-WBNR-Posting-Host: 67.180.214.235
| From: =?Utf-8?B?Um9iZXJ0?= <ro*****@noemail.nospam>
| Subject: VS2005 - Changes to configuration sections between beta 2 and
rele
| Date: Sat, 29 Oct 2005 17:06:05 -0700
| Lines: 68
| Message-ID: <DF**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.general
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.general:53084
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| I have an application with custom configuration sections in it's
app.config
| file.
|
| Here's a shortened excerpt:
|
| <monitors>
| <monitor
| type="SystemMonitor.Monitors.NetworkAvailabilityMo nitor,SystemMonitor">
| <notifiers>
| <notifier type="SystemMonitor.Notifiers.MessageBoxNotifier,S ystemMonitor"
/>
| <notifier type="SystemMonitor.Notifiers.EventLogNotifier,Sys temMonitor">
| </notifier>
| </notifiers>
| </monitor>
| </monitors>
|
| here's some code from the application. Note again shortened, this is
only
| the section defining a "monitor" section above:
|
| mports System
| Imports System.Collections.Generic
| Imports System.Text
| Imports System.Configuration
|
| Namespace Configuration
| Class MonitorElement
| Inherits ConfigurationElement
|
| <ConfigurationProperty("type")> _
| Public Property TypeName() As String
| Get
| Return CStr(MyBase.Item("type"))
| End Get
| Set(ByVal value As String)
| MyBase.Item("type") = value
| End Set
| End Property
|
| <ConfigurationProperty("settings", IsDefaultCollection:=False)> _
| Public ReadOnly Property Settings() As SettingElementCollection
| Get
| Return CType(MyBase.Item("settings"),
| SettingElementCollection)
| End Get
| End Property
|
| <ConfigurationProperty("notifiers", IsDefaultCollection:=False)> _
| Public ReadOnly Property Notifiers() As NotifierElementCollection
| Get
| Return CType(MyBase.Item("notifiers"),
| NotifierElementCollection)
| End Get
| End Property
| End Class
| End Namespace
|
| Under VS2005 Beta2, this worked just fine. However, now i have
recompiled
| using VS2005 RTM and am getting an error on the line that says:
|
| <monitor type=.....
|
| Specifically the error is that "type" is not defined.
|
| So obviously something was changed but I am having trouble determing what
| was changed so i can fix the code in question.
|
| Thanks in advance,
| Robert.
|

Oct 31 '05 #2

P: n/a
Thanks, I was able to figure this out today. The error was at the topmost
level where i needed to change the syntax of how the custom configuration
section was returned in the get function.

"Steven Cheng[MSFT]" wrote:
Hi Robert,

Welcome to MSDN newsgroup.

From your description, you've implement some custom configuration section
handlers, elements /elementcollections through the .NET 2.0 configuration
model. However, the code broke when move from beta2 to the RTM
environment,yes?

Based on the code snippet you provided, it seems that the problem is
concerned to the element within a collection Element, have you tried move
that problem element out of collection and test it directly under the
Section element to see whether it also cause the same error?

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| Thread-Topic: VS2005 - Changes to configuration sections between beta 2
and rele
| thread-index: AcXc5bidBXvi9xouRk6wjOqqLCrwKw==
| X-WBNR-Posting-Host: 67.180.214.235
| From: =?Utf-8?B?Um9iZXJ0?= <ro*****@noemail.nospam>
| Subject: VS2005 - Changes to configuration sections between beta 2 and
rele
| Date: Sat, 29 Oct 2005 17:06:05 -0700
| Lines: 68
| Message-ID: <DF**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.general
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.general:53084
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| I have an application with custom configuration sections in it's
app.config
| file.
|
| Here's a shortened excerpt:
|
| <monitors>
| <monitor
| type="SystemMonitor.Monitors.NetworkAvailabilityMo nitor,SystemMonitor">
| <notifiers>
| <notifier type="SystemMonitor.Notifiers.MessageBoxNotifier,S ystemMonitor"
/>
| <notifier type="SystemMonitor.Notifiers.EventLogNotifier,Sys temMonitor">
| </notifier>
| </notifiers>
| </monitor>
| </monitors>
|
| here's some code from the application. Note again shortened, this is
only
| the section defining a "monitor" section above:
|
| mports System
| Imports System.Collections.Generic
| Imports System.Text
| Imports System.Configuration
|
| Namespace Configuration
| Class MonitorElement
| Inherits ConfigurationElement
|
| <ConfigurationProperty("type")> _
| Public Property TypeName() As String
| Get
| Return CStr(MyBase.Item("type"))
| End Get
| Set(ByVal value As String)
| MyBase.Item("type") = value
| End Set
| End Property
|
| <ConfigurationProperty("settings", IsDefaultCollection:=False)> _
| Public ReadOnly Property Settings() As SettingElementCollection
| Get
| Return CType(MyBase.Item("settings"),
| SettingElementCollection)
| End Get
| End Property
|
| <ConfigurationProperty("notifiers", IsDefaultCollection:=False)> _
| Public ReadOnly Property Notifiers() As NotifierElementCollection
| Get
| Return CType(MyBase.Item("notifiers"),
| NotifierElementCollection)
| End Get
| End Property
| End Class
| End Namespace
|
| Under VS2005 Beta2, this worked just fine. However, now i have
recompiled
| using VS2005 RTM and am getting an error on the line that says:
|
| <monitor type=.....
|
| Specifically the error is that "type" is not defined.
|
| So obviously something was changed but I am having trouble determing what
| was changed so i can fix the code in question.
|
| Thanks in advance,
| Robert.
|

Nov 1 '05 #3

P: n/a
Thanks for the response Robert,

Glad that you've figured the problem out. If there're anything else we can
help later, please feel free to post here.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: VS2005 - Changes to configuration sections between beta 2
and
| thread-index: AcXeg6UuuA6U7jx1TBWR9kQwwgHH7A==
| X-WBNR-Posting-Host: 67.180.214.235
| From: =?Utf-8?B?Um9iZXJ0?= <ro*****@noemail.nospam>
| References: <DF**********************************@microsoft.co m>
<vX**************@TK2MSFTNGXA01.phx.gbl>
| Subject: RE: VS2005 - Changes to configuration sections between beta 2 and
| Date: Mon, 31 Oct 2005 17:29:04 -0800
| Lines: 131
| Message-ID: <A8**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.general
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.general:53206
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| Thanks, I was able to figure this out today. The error was at the
topmost
| level where i needed to change the syntax of how the custom configuration
| section was returned in the get function.
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Robert,
| >
| > Welcome to MSDN newsgroup.
| >
| > From your description, you've implement some custom configuration
section
| > handlers, elements /elementcollections through the .NET 2.0
configuration
| > model. However, the code broke when move from beta2 to the RTM
| > environment,yes?
| >
| > Based on the code snippet you provided, it seems that the problem is
| > concerned to the element within a collection Element, have you tried
move
| > that problem element out of collection and test it directly under the
| > Section element to see whether it also cause the same error?
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| > --------------------
| > | Thread-Topic: VS2005 - Changes to configuration sections between beta
2
| > and rele
| > | thread-index: AcXc5bidBXvi9xouRk6wjOqqLCrwKw==
| > | X-WBNR-Posting-Host: 67.180.214.235
| > | From: =?Utf-8?B?Um9iZXJ0?= <ro*****@noemail.nospam>
| > | Subject: VS2005 - Changes to configuration sections between beta 2
and
| > rele
| > | Date: Sat, 29 Oct 2005 17:06:05 -0700
| > | Lines: 68
| > | Message-ID: <DF**********************************@microsoft.co m>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.general
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.general:53084
| > | X-Tomcat-NG: microsoft.public.dotnet.general
| > |
| > | I have an application with custom configuration sections in it's
| > app.config
| > | file.
| > |
| > | Here's a shortened excerpt:
| > |
| > | <monitors>
| > | <monitor
| > |
type="SystemMonitor.Monitors.NetworkAvailabilityMo nitor,SystemMonitor">
| > | <notifiers>
| > | <notifier
type="SystemMonitor.Notifiers.MessageBoxNotifier,S ystemMonitor"
| > />
| > | <notifier
type="SystemMonitor.Notifiers.EventLogNotifier,Sys temMonitor">
| > | </notifier>
| > | </notifiers>
| > | </monitor>
| > | </monitors>
| > |
| > | here's some code from the application. Note again shortened, this is
| > only
| > | the section defining a "monitor" section above:
| > |
| > | mports System
| > | Imports System.Collections.Generic
| > | Imports System.Text
| > | Imports System.Configuration
| > |
| > | Namespace Configuration
| > | Class MonitorElement
| > | Inherits ConfigurationElement
| > |
| > | <ConfigurationProperty("type")> _
| > | Public Property TypeName() As String
| > | Get
| > | Return CStr(MyBase.Item("type"))
| > | End Get
| > | Set(ByVal value As String)
| > | MyBase.Item("type") = value
| > | End Set
| > | End Property
| > |
| > | <ConfigurationProperty("settings",
IsDefaultCollection:=False)> _
| > | Public ReadOnly Property Settings() As
SettingElementCollection
| > | Get
| > | Return CType(MyBase.Item("settings"),
| > | SettingElementCollection)
| > | End Get
| > | End Property
| > |
| > | <ConfigurationProperty("notifiers",
IsDefaultCollection:=False)> _
| > | Public ReadOnly Property Notifiers() As
NotifierElementCollection
| > | Get
| > | Return CType(MyBase.Item("notifiers"),
| > | NotifierElementCollection)
| > | End Get
| > | End Property
| > | End Class
| > | End Namespace
| > |
| > | Under VS2005 Beta2, this worked just fine. However, now i have
| > recompiled
| > | using VS2005 RTM and am getting an error on the line that says:
| > |
| > | <monitor type=.....
| > |
| > | Specifically the error is that "type" is not defined.
| > |
| > | So obviously something was changed but I am having trouble determing
what
| > | was changed so i can fix the code in question.
| > |
| > | Thanks in advance,
| > | Robert.
| > |
| >
| >
|

Nov 1 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.