Skip to content
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

Invoke-DbaQuery not working #1575

Closed
adamdriscoll opened this issue Sep 19, 2022 · 7 comments
Closed

Invoke-DbaQuery not working #1575

adamdriscoll opened this issue Sep 19, 2022 · 7 comments
Labels
bug Something isn't working PowerShell Universal Issue relates to PowerShell Universal.

Comments

@adamdriscoll
Copy link
Member

Steps to Reproduce

https://forums.ironmansoftware.com/t/psu-3-3-0-nightly-invoke-dbaquery-not-working-anymore/7730

Expected behavior

Invoke-DbaQuery works

Actual behavior

Invoke-DbaQuery throws an error

Environment data

3.3.3

Visuals

No response

@adamdriscoll adamdriscoll added bug Something isn't working PowerShell Universal Issue relates to PowerShell Universal. labels Sep 19, 2022
@adamdriscoll
Copy link
Member Author

dbatools uses an older version of Microsoft.Data.SqlClient and will no longer load into the integrated environment. The work around is to use a non-integrated environment.

@potatoqualitee
Copy link

:O what version do we need to upgrade to?

@adamdriscoll
Copy link
Member Author

@potatoqualitee - We are using version 5 - https://www.nuget.org/packages/Microsoft.Data.SqlClient/#versions-body-tab

@potatoqualitee
Copy link

thank you, ill try to get to this next week 👍🏼

@potatoqualitee
Copy link

@adamdriscoll -- man, I cannot get this to work. I'm not good at DLLs, can you offer any advice?

  • To get to Microsoft.Data.SqlClient 5.0, I have to I have to find a version of SMO that supports it
  • Sweet! The newest prerelease of SMO does. I ❤️ a prerelease if all of our tests pass.
  • So I update to SMO 170.7.0-preview which depends on Microsoft.Data.SqlClient 5.0 and works on .NET 6.0.
  • Awesome, I can update the whole library to net6.0 on the Core side

I always start with 5.1 so I get that working (it was hell and I had to do some crazy stuff I never had to do before) and I move on to Core.

Everything compiles just fine but when I go to connect to SQL Server, I get Microsoft.Data.SqlClient platform not supported. What? So then I look at the nuget page and it says Microsoft.Data.SqlClient works on netcoreapp3.1 and doesn't list net6.0 as supported! How on earth can SMO depend on something that can't run on that version of .net? Is there hope?

@potatoqualitee
Copy link

Solved it 😮‍💨

microsoft/sqlmanagementobjects#114 (comment)

@adamdriscoll
Copy link
Member Author

@potatoqualitee Wooooo! Glad you got it working. Sorry I didn't get to your comment this weekend!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PowerShell Universal Issue relates to PowerShell Universal.
Projects
None yet
Development

No branches or pull requests

2 participants