Results 1 to 4 of 4

Thread: Automatic Type Inference not working in one project but works in another

  1. #1

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Automatic Type Inference not working in one project but works in another

    I'm having this peculiar problem where the automatic type inference (ATI) for linq has stopped working in one of my projects. The project is of "Class Library" type.

    However if I create a new project of same type and add the same code, it works there. I'm assuming my project file has become corrupt. The project is huge (approx 150 files) and I don't want to get into the hassle of creating it again and adding all the files, unless there is no other way out.

    Here are some screenshots:

    Description: As we can see that in the first screenshot, the ATI is working whereas in the second one it doesn't.

    Name:  1.png
Views: 223
Size:  37.6 KB



    Description: Here we can see that in the first screenshot, the intellisense is working whereas in the second one it doesn't.

    Name:  2.png
Views: 269
Size:  47.0 KB

    I have been all over the net (incl msdn) but couldn't find the solution. May be I am searching using a wrong keyword? But anyways, I am about to pull all my hair off my head!!!!

    Any help is appreciated.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  2. #2
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    Re: Automatic Type Inference not working in one project but works in another

    Remove your references to Linq and then add them back in. I had to do that with one of my classes because the reference links were somehow broken.
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Automatic Type Inference not working in one project but works in another

    On an unrelated note, can I ask why you have Option Explicit On at the top of your code? The only reason to have that is if you have Option Explicit Off in the project properties. Please tell me that's not the case! There is absolutely no justification for anyone to have Option Explicit Off so it should be On in the IDE options, in which case it will be On in every project and therefore On in every code file.

  4. #4

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Automatic Type Inference not working in one project but works in another

    @circuits2:
    I tried your suggestion, but it didn't help. Removing the reference tells me that I'm missing a Linq reference. Putting it back on has the same effect as shown in my original post.

    @jmcilhinney:
    I was trying with different combinations of Option Strict and Option Explict to verify that these settings are not the culprits. Also the code shown is only for test. The actual ReportDriver code is about 1500 lines of code. In my projects, the Option Explict is ON by default. However Option Strict is OFF and we set it for each individual class file explicitly.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width