-
Notifications
You must be signed in to change notification settings - Fork 772
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
Runtime error with SqlEntityConnection TP under VS 2015 RC and F# 3.1 #492
Comments
Hi @toburger - I can't repro the issue given the current description. My simple SQL entity app works fine targeting 3.1 from 4.0 Some further questions for you:
|
Someone else reported this internally, as well, and was able to share full repro. I think I know the root cause now. Query expressions get compiled into F# code quotations, and those get serialized in the resulting assembly. In this case the quotations contain a bogus reference to the temp assemblies used behind the scenes within the SQL type provider. They should reference the local assembly (where temp asms get statically linked), but for some reason in this cross-version scenario they are still pointing at the phantom temp assembly. Workarounds:
open System
open System.Reflection
AppDomain.CurrentDomain.add_AssemblyResolve(fun _ evtArgs ->
// might want to make this a bit more robust
if evtArgs.Name.StartsWith("tmp") then Assembly.GetExecutingAssembly()
else null
) |
Wow good catch |
@latkin - agreed that should be a call to ConvILTypeRefUnadjusted |
When I use the SqlEntityConnection Type Provider with Visual Studio 2015 RC (Visual FSharp 4.0 Preview 06-03-2015) I get a runtime error when I use a different Target Runtime than 4.0.
When running the project with 4.0 everything works as expected, but when I switch the Target Runtime to 3.1 I get a runtime error:
Visual Studio 2013 with Target Runtime 3.1 doesn't crash (which uses v3.1\fsc.exe).
The text was updated successfully, but these errors were encountered: