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 8728321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:36:43+00:00 2026-06-13T08:36:43+00:00

I have recently switched from a c# team to a vb.net team. One of

  • 0

I have recently switched from a c# team to a vb.net team. One of the things I have not been able to find an answer to is the differences in compile error / options. Let me explain.

In C# i will, using default settings, get a compile time error when trying to pass in an invalid type to a templated class like below. Here I create an Animal with a string type and afterwards I pass in a datetime which results in an compile error.

 IAnimal<string> animal = new Animal<string>();
 animal.SetTrainer(DateTime.Now);

I know I will get the same compile time error in vb.net with “Option Strict”. There is, however, a lot of legacy (VB) code in the same file that will not compile with “Option Strict”. What options do I have. Im thinking this:

  1. Switch to “Option Strict” and fix all errors. Will take some time and may break working code.
  2. Maybe there is an alternate that will ensure compile time check of generics. After all generics are rather new so maybe there is a way of always enforcing this.
  3. ?

Thanks in advance

  • 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-06-13T08:36:45+00:00Added an answer on June 13, 2026 at 8:36 am

    Double click your Project -> My Project.

    Goto Compile and look for Warningconfiguration

    Now you can change some settings.

    • Implicit cast
    • Late Binding

    don’t make them errors but warnings.

    That won’t make compile time errors but you can at least see some warnings.

    Another solution would be to make your class a partial class and move your code to a new file. You can set Option Strict / Option Explicit on a per file basis.

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

Sidebar

Related Questions

I recently switched from VB to C# and have, for the most part, been
I have been using rspec for a little while and recently switched style from
I recently switched from MySQL to PostgreSQL. I have one problem left however. Previously,
I have recently switched back to IntelliJ from Eclipse and one thing I am
I have recently switched from Netbeans to Eclipse. I have a project which contains
We just recently switched from Visual Studio 2008 to Visual Studio 2010. I have
We have a WCF service that we recently switched from self-hosting to IIS-hosted. It
The project I work on has recently been switched from a horribly antiquated revision
I recently switched to J2EE from .NET, and am confused about where to put
I recently switched over to C# from vb.NET and within visual studio found that

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.