2 Attachment(s)
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.
Attachment 99297
Description: Here we can see that in the first screenshot, the intellisense is working whereas in the second one it doesn't.
Attachment 99299
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!!!! :afrog:
Any help is appreciated. :thumb:
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.
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.
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.