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

  • Home
  • SEARCH
  • 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 6120381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:39:43+00:00 2026-05-23T15:39:43+00:00

I am updating a legacy application, and it was reading a dll from another

  • 0

I am updating a legacy application, and it was reading a dll from another project for a Dictionary(of Guid, String) of items and using them.

The requirements have changed, and the method that was returning the Dictionary is now returning an IList.

This is the odd behavior of this; the intellisense is not throwing a cast error, nor is the compiler. It does not throw an error until runtime when it tries to set the Dictionary to the IList.

Example:

        Dim someDictionary As Dictionary(Of Integer, String) = New Dictionary(Of Integer, String)
        Dim someList As IList(Of Integer)
        someDictionary = someList

Any idea as to why the compiler is not catching this?

  • 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-23T15:39:44+00:00Added an answer on May 23, 2026 at 3:39 pm

    It gives an error when "Option Strict" is On:

    Option Strict On
    
    Imports System.Collections.Generic
    
    Public Class Test
        Public Shared Sub Main()
            Dim someDictionary As Dictionary(Of Integer, String) = _
                   New Dictionary(Of Integer, String)
            Dim someList As IList(Of Integer) = Nothing
            someDictionary = someList
        End Sub
    End Class
    

    Error:

    error BC30512: Option Strict On disallows implicit conversions from ‘System.Collections.Generic.IList(Of Integer)’ to ‘System.Collections.Generic.Dictionary(Of Integer, String)’.

       someDictionary = someList
    

    I suggest you change your project to enable Option Strict, to help catch this sort of thing 🙂

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

Sidebar

Related Questions

After updating to Parsec 3.1 from 2.x, code using many1, such as word =
I am working on updating a legacy application that is absolutely rife with Singleton
I'm updating legacy code written in VB6 using Winsock controls. Essentially, I'm trying to
I'm updating some legacy code from the old 3.0 version of the C# Facebook
After updating from 3.0.1 to 3.1.1 my application according the relevant railscast i seem
I have encountered a weird situation while updating/upgrading some legacy code. I have a
After updating to XCode 4.3, all my archives built using XCode 4.2 are gone.
For updating in my .properties file I am using Apache Commons Configuration's PropertiesConfiguration .
I've been looking into a legacy application with a web-based user interface. Given its
I'm working updating some legacy code that does not properly handle user input. The

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.