VS2005 - Changes to configuration sections between beta 2 and rele

G

Guest

I have an application with custom configuration sections in it's app.config
file.

Here's a shortened excerpt:

<monitors>
<monitor
type="SystemMonitor.Monitors.NetworkAvailabilityMonitor,SystemMonitor">
<notifiers>
<notifier type="SystemMonitor.Notifiers.MessageBoxNotifier,SystemMonitor" />
<notifier type="SystemMonitor.Notifiers.EventLogNotifier,SystemMonitor">
</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.
 
S

Steven Cheng[MSFT]

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?= <[email protected]>
| Subject: VS2005 - Changes to configuration sections between beta 2 and
rele
| Date: Sat, 29 Oct 2005 17:06:05 -0700
| Lines: 68
| Message-ID: <[email protected]>
| 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.NetworkAvailabilityMonitor,SystemMonitor">
| <notifiers>
| <notifier type="SystemMonitor.Notifiers.MessageBoxNotifier,SystemMonitor"
/>
| <notifier type="SystemMonitor.Notifiers.EventLogNotifier,SystemMonitor">
| </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.
|
 
G

Guest

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.
 
S

Steven Cheng[MSFT]

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?= <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: RE: VS2005 - Changes to configuration sections between beta 2 and
| Date: Mon, 31 Oct 2005 17:29:04 -0800
| Lines: 131
| Message-ID: <[email protected]>
| 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!TK2MSFTNGXA03.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?= <[email protected]>
| > | Subject: VS2005 - Changes to configuration sections between beta 2
and
| > rele
| > | Date: Sat, 29 Oct 2005 17:06:05 -0700
| > | Lines: 68
| > | Message-ID: <[email protected]>
| > | 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.NetworkAvailabilityMonitor,SystemMonitor">
| > | <notifiers>
| > | <notifier
type="SystemMonitor.Notifiers.MessageBoxNotifier,SystemMonitor"
| > />
| > | <notifier
type="SystemMonitor.Notifiers.EventLogNotifier,SystemMonitor">
| > | </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.
| > |
| >
| >
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top