So I’ve been working locally on my machine, trying to parse an XML document. Here’s my code:
XDocument xmlInput = XDocument.Load(new StringReader(xml));
var properties = from p in xmlInput.Descendants("Property")
select new
{
PropertyID = Int32.Parse(p.Value)
};
This works fine locally. But when I push to the production server, I get this error when I’m setting properties:
CS1002: ; expected
I think it’s having a problem recognizing var, but I’m not completely sure. I think there might be some differences between my machine and the production server, but I don’t know what. Is there maybe a specific namespace I should be looking for on my production server?
The version of .net you are running on the server doesn’t match your local version.
Basically, you need to install the .net 3.5 framework on your server.