473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

TypeLoadException with inherited type

I created an inherited version of the NameValueCollection, because I
wanted to include some overloads of the Get method. When I try and use
the collection, I get:

===============================
An unhandled exception of type 'System.TypeLoadException' occurred in
MyCode.Letter.

Additional information: Could not load type
MyCode.DataAccess.NVCollection from assembly MyCode.DataAccess,
Version=1.0.2454.19127, Culture=neutral, PublicKeyToken=null.
===============================

I don't understand why it's giving me this problem. Here's the entire
MyCode.DataAccess.NVCollection class:

===============================
Public Class NVCollection
Inherits System.Collections.Specialized.NameValueCollection

Public Overloads Overrides Function [Get](ByVal name As String) As
String
Dim str As String = MyBase.Get(name)
If str Is Nothing Then Return ""
Return str
End Function

Public Overloads Function [Get](ByVal name As String, ByVal
[default] As String) As String
Dim str As String = MyBase.Get(name)
If str Is Nothing Then Return [default]
If str = "" Then Return [default]
Return str
End Function

Public Overloads Function [Get](ByVal name As String, ByVal
[default] As Integer, ByVal min As Integer, ByVal max As Integer) As
Integer
Dim str As String = MyBase.Get(name)
If str Is Nothing Then Return [default]
If str = "" Then Return [default]
Dim r As System.Text.RegularExpressions.Regex = New
System.Text.RegularExpressions.Regex("\d+")
Dim m As System.Text.RegularExpressions.Match = r.Match(str)
If Not m.Success Then Return [default]
If CInt(str) < min Or CInt(str) max Then Return [default]
Return CInt(str)
End Function
End Class
===============================

It could hardly be any simpler, but it's blowing up on me. Can anyone
explain why?

Thanks,
Lisa

Sep 20 '06 #1
0 924

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Magnus Lindhe | last post by:
Hello, I'm trying to deserialize an XML document into a objects with the XmlSerializer which works fine in my NUnit test suit but fails with a TypeLoadException in the server. The difference...
1
by: @ndre | last post by:
Any type declaration of double leads to a TypeLoadException when run in cf (no compilation error), i.e. cf = reduced c# set??? see example below comments? @ndre this compiles with cf, but give...
0
by: Tintax | last post by:
Hi All, I'm trying to create a generic node class for generating class hierarchies like XmlNode/XmlDocument. Unfortunately I'm running into an interesting problem where my code compiles fine but...
2
by: Scott Wisniewski | last post by:
I am attempting to write a class to expose the STL map class to .NET languages as an IDictionary. As part of the implementation I created an implementation of IEnumerator that contains a pointer to...
0
by: phillip | last post by:
This is interesting, I have attached my web.config file and the exception I have been logging. I created a library which provide data access to a database and a control system. The library is...
0
by: ryan groth | last post by:
Every three or four compiles I get a TypeLoadException everytime I run a web application on the same one or two dlls. The exception information is vauge, no file errors, no permission errors, no...
0
by: Pierre-Alain Vigeant | last post by:
Hi, I'm getting a TypeLoadException inside an object that is located in a DLL that is dynamically loaded. I have this main program "main.exe" that dynamically load "main.dll" using o =...
1
by: Tom | last post by:
Having some trouble with my assembly running another assembly, and I am starting to suspect this may be a windows bug or a framework bug. Everything works fine on my development workstation (XP...
3
by: O.B. | last post by:
I recently changed a struct to a class and made its layout Sequential instead of Explicit for Marshalling. And now I'm getting the following error when running my unit tests. I have verified that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.