VS2012 projects are mostly* backwards compatible with VS2010 SP1. The projects will undergo a conversion/migration process like in all previous VS versions, but this one is friendly towards VS2010. You should be able to make changes to your projects/references/code files and open them again in VS2010 without issues.
I say mostly because there are some features new in VS2012 that may not be backwards compatible. The most obvious, if you upgrade a project to .NET 4.5, it will no longer work in VS2010. See http://blogs.msdn.com/b/visualstudio/archive/2012/03/28/round-tripping-with-visual-studio-11.aspx for more information about this scenario.
Well, not sure exactly what you're trying to do here, but an anonymous type != a Table object. The exception indicates you're trying to cast an IEnum of an anonymous type (a compiler-generated class with a weird name) to an IEnum of type Table.
You can't cast types willy nilly in C#. You can't, for instance, do this:
(Table)"Lol I'd like to be a table pls kthx"
You can't cast any type that isn't already a Table, or extends from Table, to a Table.
So what you're asking is impossible. You should probably take a step back and ask a more general question about what you're trying to accomplish.
Some more on anon types... They only really have meaning within the scope of the method in which they are defined. It appears you might be returning your anon type enumeration from a method call and then are attempting to sort. This won't work, as once the anonymous type leaves the method scope it is considered (at least by intellisense) to be an object and the only way to get at its properties is to use reflection.
If your example isn't just a simplified version, you could just skip the anon type altogether...
this.bindingSource.DataSource =
from row in db.Table
select row.Name + row.Num.ToString();
This is an IEnumerable, and can be queried thusly:
var query = from row in anotherBindingSource
where row.StartsWith("asd")
select row;
However it doesn't look like you're accomplishing much at all with this...
You cannot query anonymous types outside of the scope in which they are defined.
This works:
public void Worthless(Hurr hurr)
{
var query = from x in hurr select new { x.Durr };
var requery = from x in query where x.Durr == "lol" select x;
}
This does not:
public class Anonymous
{
public IEnumerable GetMyDurrs(Hurr hurr)
{
return from x in Hurr select new { x.Durr };
}
public IEnumerable WeedMyDurrs(Hurr hurr, string value)
{
// this won't compile
return from x in GetMyDurrs(hurr) where x.Durr == value select x;
}
}
The second example won't compile because the anonymous type was defined within another scope.
The only way to get this to work is to define a type.
public class Anonymous
{
public IEnumerable<Anonymous.MyDurr> GetMyDurrs(Hurr hurr)
{
return from x in Hurr select new MyDurr { Durr = x.Durr };
}
public IEnumerable<Anonymous.MyDurr> WeedMyDurrs(Hurr hurr, string value)
{
// this won't compile
return from x in GetMyDurrs(hurr) where x.Durr == value select x;
}
public class MyDurr { public string Durr {get;set;} }
}
Best Answer
It depends on the type of project.
For most (standard) types, for example web projects (Full .NET Framework), Windows projects VS 2017 is forward and backward compatible with VS 2015, solutions and projects formats are the same.
But not compatible for .NET Core projects, because project.json was changed back to .csproj.