tags:

views:

1049

answers:

4

Can anyone help me here, the following works fine on my xp but not my vista machine. Im querying a Generic dictionary.

Both computers have .NET 3.5 + SP1, 3.0, 2.0, etc., and have the web project targeted to 3.5 Framework.

using System.Linq;
string val = "Test";
var d = DictionaryOfStuff().Where(n => n.Key.ToLower().Contains(val.ToLower()));

Gives me the error: CS1525: Invalid expression term '>'

I can run this in a differnet project on vista, I have IIS configured to use .NET 2.0 and the project in VS targeted at 3.5 I have even tried adding this to the web.config, it compiles fine w/o any lambda/linq

+4  A: 

Based on the error message, I would have to say there is a configuration issue on your Vista machine and the web projects are using the 2.0 compiler instead of the 3.5 compiler. This is the only reason I can think of that you would get this message.

Make sure that

  • IIS is configured properly
  • Web settings are configured properly.
JaredPar
I have configured all i can think to, what else might i have to do other than whats mentioned (modified) above?
schmoopy
A: 

What is "val" in this case? You never declared it in your sample. Did you mean "n.Value"?

Joel Coehoorn
I edited the above, val is a string passed through a parm, but above should make more sense now :-)
schmoopy
+3  A: 

Well, here was the answer..

I changed the project to target .NET 3.0, tried to compile got all kinds of errors, changed it back to 3.5 and it compiled fine.

I musta had an old reference in there from something.

schmoopy
So odd. Same thing happened to me, and the target switch worked fine. Heh, thanks.
Vasi
A: 

schmoopy you rock :) and Visual studio :P just stuck in same issue since morning :P

http://www.hyperlinksolutions.net http://barchitect.blogspot.com

Zafar