-
Notifications
You must be signed in to change notification settings - Fork 15
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
Can not compile typed context: Assembly 'Madd0.AzureStorageDriver' #20
Comments
I had good hope since nobody else had seen the error since the update... |
Probably not so many TS users 🙃 Requested data:
Info from driver:
Hm... Looks like you are using some |
I think using |
Thanks for the information. I'm running the exact same environment as you are. .NET Core 3.1 uses System.Runtime 4.2.2. Since the driver itself targets 3.1 and that the generated code references the driver, it will need System.Runtime 4.2.2 in the end anyway. I do not have reliable reproduction steps, but I did manage to encounter the exception when I opened LinqPad 6 today (I don't use 6 much because I only have a license for 5 and I can't live without autocomplete). What the debugger is showing me is that, although the driver DLL that was loaded targets .NET Core 3.1, LinqPad is giving it 3.0 DLLs to compile the generated code, which results in the exception you are getting. I've reached out to the author hoping he'll have an idea of what might be going wrong. I'll also try to investigate further during the course of the weekend. |
Thanx for feedback. Hope LinqPad then will be fixed. |
Quick update: After exchanging with Joe Albahari, I have a better understanding of what is going wrong. We have discussed of possible improvements in LinqPad to avoid the issue in the future, and I have an idea for a workaround in the meantime. I hope I'll be able to patch and test before the end of the week. |
Great news! :) |
This is a workaround for issue #20, which appears to be the opposite of #19. In the latter, the driver was given .net core 3.1 references when it was trying to target 3.0. This time, the driver is given 3.0 references while trying to target 3.1. It looks like LinqPad is downloading the 3.1 version of the driver, which tries to generate a dynamic assembly by targeting 3.1 too. This is necessary because the generated code references the driver assembly, which in this scenario targets 3.1. However, LinqPad is providing reference assemblies for .net core 3.0, which results in a compiler error. I talked about the problem with Joe Albahari and hope that in the future the driver will be able to request version-specific reference assemblies from LinqPad. In the meanwhile, since the dynamic assembly should be 3.0-compatible if it doesn't reference the 3.1 driver itself, I have removed the reference and am now compiling the required classes with the rest of the code. This way, whether LinqPad provides 3.0 or 3.1 references, the generated code is totally agnostic and works with both.
Hopefully this'll do the trick: https://www.nuget.org/packages/Madd0.AzureStorageDriver/2.1.1 |
I updated and can confirm it works now. |
Are you going to make |
I'll look into it. In the meanwhile, specifying
Calls:
|
Nice trick. Didn't know :) |
Ah, right, that's because |
When trying to connect to Azure TableStorage from LinqPad6 (using nuget driver) I recieve an error:
Error: Can not compile typed context: Assembly 'Madd0.AzureStorageDriver' with identity 'Madd0.AzureStorageDriver, Version 2.1.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Runtime, Version 4.2.2.0, Culture=neutral, ...
In LinqPad5 the same connection is working and I am able to connect using TableStorage driver.
Are there some prerequisites needed? LinqPad is working by itself. And able to connect to SQL.
I saw closed ticked, but the problem seems not solved... Driver version 2.1.0.0
The text was updated successfully, but these errors were encountered: