-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compatibility with F# 3.1 #203
Conversation
Code compiled with VS2013 that used FSharp.Data wasn't working because FSharp.Data still targets F# 3.0. Now we detect that case and also replace the FSharp.Core reference like we do for portable class libraries and silverlight (works even if FSharp.Data.DesignTime.dll is compiled in VS2012) WIP - XmlProvider still is not working, probably still misses a ToDesignTime somewhere, as in this scenario even in full framework we replace assemblies (silverlight didn't support xml, so the problems are probably there since ever). But at least it now fails at compile time instead of at runtime
Cool! Thanks for looking into this - just to make sure I get it, in which case is this needed?
(The pull request is looking good to me, just trying to understand what is happening :-)) |
As long as we keep FSharp.Data targeting FSharp.Core 4.3.0.0, it's irrelevant if it's compiled with VS2012 or VS2013, for both runtime and design time assemblies (I even compared the generated il with ildasm and it's exactly the same) The problem is when someone is using VS2013 for its projects and wants to use FSharp.Data. In this scenario, FSharp.Data.DesignTime.dll is loaded inside the F# 3.1 compiler and that's what causes problems. This can be reproduced by building the tests solution with VS2013 (regardless of what version was used to compile the main solution). These changes fix this scenario by treating it as a cross compilation. Which means we have to load both versions of FSharp.Core and replace the references, which is only possible when loafing in the ReflectionOnly mode, otherwise Assembly.LoadFrom fails, etc, etc... All of this assuming that even using VS2013 the code is still targeting 4.3.0.0. To be able to support 4.3.1.0, we'll have to have a version of the runtime assembly also targeting it (the design time assembly can stay as is). This will be tricky because NuGet only knows about .Net 4.0/4.5 platforms, it doesn't know the difference between 4.0/FS30 4.0/FS31 4.5/FS0 4.5/FS31. So we'll probably have to have two separate NuGet packages. @dsyme, any guidance on what should be the best practice here? Alternatively, we could just update everything to target FSharp.Core 4.3.1.0 and we wouldn't need any of this, but that would mean F# 3.0 would no longer be supported. From: Tomas Petricek Cool! Thanks for looking into this - just to make sure I get it, in which case is this needed?
(The pull request is looking good to me, just trying to understand what is happening :-)) Reply to this email directly or view it on GitHub: |
We should also start considering if we should also support the new Portable profile supported by F# 3.1 |
Fix compatibility with F# 3.1
Oh man, that's messy. Thanks for the clarification & great work on finding the workaround!
|
Code compiled with VS2013 that used FSharp.Data wasn't working because FSharp.Data still targets F# 3.0. Now we detect that case and also replace the FSharp.Core reference like we do for portable class libraries and silverlight (works even if FSharp.Data.DesignTime.dll is compiled in VS2012)
WIP - XmlProvider still is not working, probably still misses a ToDesignTime somewhere, as in this scenario even in full framework we replace assemblies (silverlight didn't support xml, so the problems are probably there since ever). But at least it now fails at compile time instead of at runtime