Polyglot notebook issue with EF
Describe the bug
I am using VS Code Polyglot notebook extension with .ipynb notebook to test EF functionality. This feature used to work before but suddenly stopped. Here is the command that I am using
#!connect mssql --create-dbcontext --kernel-name OracleHR "Server=cpateldev;Database=OracleHR;User Id=sa;Password=!Sa@dmin;Encrypt=yes;Trust Server Certificate=Yes;"
Error that I get is as below
Scaffolding a DbContext and initializing an instance of it called OracleHR in the C# kernel. Error: Microsoft.Identity.Client version 4.66.2 cannot be added because version 4.66.1 was added previously.
Please complete the following:
Which version of .NET Interactive are you using? (In a notebook, run the #!about magic command. ):
- OS
- [x] Windows 11
- [ ] Windows 10
- [ ] macOS
- [ ] Linux (Please specify distro)
- [ ] iOS
- [ ] Android
- Browser
- [ ] Chrome
- [ ] Edge
- [ ] Firefox
- [ ] Safari
- Frontend
- [ ] Jupyter Notebook
- [ ] Jupyter Lab
- [ ] nteract
- [x] Visual Studio Code
- [ ] Visual Studio Code Insiders
- [ ] Visual Studio
- [ ] Other (please specify)
Screenshots
If applicable, add screenshots to help explain your problem.
NOTE: OracleHR is just name of the MSSQLServer database hosted in local docker container
FYI, I was able to workaround this issue by explicitly importing the package version mentioned in the error message. Adding this:
#r "nuget: Microsoft.Identity.Client, 4.66.2"
before the #!connect command works for me.
FYI, I was able to workaround this issue by explicitly importing the package version mentioned in the error message. Adding this:
#r "nuget: Microsoft.Identity.Client, 4.66.2" before the
#!connectcommand works for me.
By executing the above line before importing [ #r "nuget:Microsoft.DotNet.Interactive.SqlServer,-" ] package solves the issue. I am now able to execute EF DBContext using C# linq to EF.
I confirmed that the bug is still there, so it's good to leave this open until there's a fix.