I've got a VS2010 solution point at a website running under ASPNet 4.0. The code and the website run fine, but when I'm in VS and click Rebuild Solution, I get a spurious error message that flashes by "The type or namespace var could not be found."
Now, I do have a statement
var x = webService.GetData();
in my C# code, but that's legal with any framework > 2...
Aspnet_compiler builds the code without any complaints. I'm just wondering why VS is throwing this spurious exception... Any ideas?
When I use Build Web Site, the compiler errors about the var usage don't flash by; they stay on the screen and it says Build failed. When I use Rebuild Web Site, the complaints flash by and then disappear.
Interestingly, Rebuild also produces a warning that Build does not:
The following assembly has dependencies on a version of the .NET Framework that is higher than the target and might not load correctly during runtime causing a failure: AjaxControlToolkit...
We had a very old version of AjaxControlToolkit, so I tried updating it. The last several releases have a very long list of version mismatches.
mmodrall
Member
24 Points
50 Posts
VS2010, solution pointing at ASPNet4.0 website, odd seemingly inaccurate compile error
Feb 08, 2013 09:58 PM|LINK
Hi...
I've got a VS2010 solution point at a website running under ASPNet 4.0. The code and the website run fine, but when I'm in VS and click Rebuild Solution, I get a spurious error message that flashes by "The type or namespace var could not be found."
Now, I do have a statement
var x = webService.GetData();
in my C# code, but that's legal with any framework > 2...
Aspnet_compiler builds the code without any complaints. I'm just wondering why VS is throwing this spurious exception... Any ideas?
Thanks
Mark
mmodrall
Member
24 Points
50 Posts
Re: VS2010, solution pointing at ASPNet4.0 website, odd seemingly inaccurate compile error
Feb 11, 2013 04:49 PM|LINK
A few more things...
When I use Build Web Site, the compiler errors about the var usage don't flash by; they stay on the screen and it says Build failed. When I use Rebuild Web Site, the complaints flash by and then disappear.
Interestingly, Rebuild also produces a warning that Build does not:
The following assembly has dependencies on a version of the .NET Framework that is higher than the target and might not load correctly during runtime causing a failure: AjaxControlToolkit...
We had a very old version of AjaxControlToolkit, so I tried updating it. The last several releases have a very long list of version mismatches.
Thanks
Mark