Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4602410
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:58:48+00:00 2026-05-21T23:58:48+00:00

I have a function which returns a list of products and a page which

  • 0

I have a function which returns a list of products and a page which displays then, but when I try to load the list on the page, I get a cryptic error:

[A]System.Collections.Generic.List`1[Product] cannot be cast to
[B]System.Collections.Generic.List`1[Product].
Type A originates from 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
in the context 'LoadNeither' at location 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'.
Type B originates from 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
in the context 'LoadNeither' at location 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'.

To me, the two types appear identical. The exception is thrown on the line:

Dim products As List(Of Product) = AppDAL.FindProducts(New ProductSearchEventArgs(SearchText, ProductSearchEventArgs.TextCriteria.Contains))

The signature of my method is:

Public Shared Function FindProducts(e As ProductSearchEventArgs) As List(Of Product)

Neither Product, the page which is calling the FindProducts method or the AppDAL class have namespaces, I can’t figure out why this doesn’t work

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T23:58:49+00:00Added an answer on May 21, 2026 at 11:58 pm

    While you might not of set a namespace in code, VB always has a default namespace name in the project properties. Have you tried Dim products As List(Of AppDAL.Product) =?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an SQL function which returns a list of Teams. I want to
Suppose I have a function like this: def getNeighbors(vertex) which returns a list of
I have a function which returns a List<Dictionary<string, object>> where object is a standard
Question: I have an SQL function which returns a list of files now I
I have a function which returns a list of property values from a collection:
I have a remote function testdwr, which returns a list of objects(test). How should
I have a function which returns a one-sided intersection of values between two input
I have a function which returns 3 numbers, e.g.: def numbers(): return 1,2,3 usually
I have this function which returns a datatype InetAddress[] public InetAddress [] lookupAllHostAddr(String host)
If I have a function which returns a reference cursor for a query, how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.