Luca75 wrote:
Hello Frans can you give us any update on how and in what time we can use our loved framework in netcore ?
Thank you
There's currently no timeframe as there are two things which are crucial that are missing:
1) an updated roadmap from Microsoft when their linker system will arrive
2) an updated roadmap from Microsoft when more classes are ported to .NET core from the BCL.
These two are related btw. Our runtime is ~500K LoC and the templates are too a lot of code so altogether we estimate roughly 1M LoC have to be ported (that's outside of the thousands of tests we have!). This isn't a small undertaking, it's a massive project to do, for the reason that a lot of functionality in the runtime relies on classes which aren't there (yet) in CoreFX.
So this means that if we port now (which means, we start now, but are finished in a couple of months which is very optimistic), we have to cull a lot of code from the runtime simply because it relies on APIs that aren't in CoreFX. It also means that when these APIs are added to CoreFX, we have to port the culled code, but that also means effectively we have to port the whole system again, as it's not something simple as 'exclude these files and things work fine on coreFX and add them later again if classes are added'.
Microsoft knows this and some time ago started working on a linker system based on the Xamarin model. This means that you don't program against a set of hand-created assemblies but simply compile against a standard and the compiler + linker creates a working set of code for you. This effectively means it solves the cull now, port again later problem: all APIs in full will be present, they'll be linked to different versions of the code in the target frameworks, e.g. full BCL classes if targeted netstandard 1.3, CoreFX if targeting netstandard1.6.
So it's a problem at the moment: we can't simply do this porting process a couple of times, we either do it once or not at all. Porting now and adding a tremendous amount of #ifdef's to the code, not to mention fighting a lot of with the immature tooling for corefx/.net core, will only make sure we have to do the porting process a couple of times simply because each time Microsoft adds a new API to CoreFX which is used by code we had removed to compile it regardless on CoreFX we have to look at all the culled code and check whether it is addable at that point.
Then I haven't even mentioned the project.json -> csproj/msbuild move they're doing at the moment, of which they themselves said they don't know yet what to do with project.json. The runtime is a couple of projects in 1 solution (8 or so), so although it would be a pain, it's manageable. It's a different story for our tests, which for sqlserver alone are 66 projects in a single solution. Most of them generated, but still. All of them have to be ported to CoreFX as well. 67MB of C# code, over 4700 files, have to be stored somewhere in a project format that's unknown (there's not a schema spec for project.json, tooling is in 'preview' and very immature).
I did start porting though, or better: I tried to start porting a smaller library, but the tooling already failed to help me (this was RC2) get things working in the editor with proper #ifdef's. An example of that is that if something is excluded for a project e.g.
#ifdef COREFX
// coreFX code
#else
// full code
#endif
it should grey out the code which is excluded. This works for normal C# projects, the tooling currently doesn't do this. It's a simple example, but for us important.
The code in the runtime is at some places over 13 years old. It works great, but there are things which aren't really 'in use' anymore, like the binary serialization support or even the XML serialization support. Porting the code makes it difficult at the moment, as culling code like that might look 'easy', but adding it back when CoreFX gets support for these APIs again (and it will!) isn't simple. Not to mention that serializing entity graphs to JSon relies on ISerializable implementation to avoid a cyclic reference mess in JSon.NET and you're already in rock-hard-place land before you know it
I want to add that we do want to port our runtime, especially considering the fact that EF core is feature-wise very simple and limited, plus we're faster too. But porting our runtime isn't a project done in a weekend, sadly, it takes a lot of time and as it's not a simple project it shouldn't be done more than once.
For now we want to wait a bit: more APIs should be added to CoreFX, what are the plans from MS about their linker / tooling offering regarding existing large code bases. At the moment it's completely unknown what they're going to do, when what is added. I'm sorry I don't have better news for you.
(edit) I've emailed Microsoft to hear more about the elements I listed above as very important, to see if / when more information is available so we can plan ahead.