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

DLL error when importing dbatools #5195

Closed
ACALVETT opened this issue Mar 12, 2019 · 10 comments
Closed

DLL error when importing dbatools #5195

ACALVETT opened this issue Mar 12, 2019 · 10 comments
Labels
bugs life Import Issues associated with importing of the module

Comments

@ACALVETT
Copy link
Contributor

ACALVETT commented Mar 12, 2019

Before submitting a bug report:

Hi,

I downloaded the latest version today and got a timeout error so ran below and receive a dll error, not sure where to start digging into that one, i do have SQL management tools installed on my machine.

Steps to Reproduce

$dbatools_serialimport=$true 
import-module dbatools

Expected Behavior

Module should load without error

Actual Behavior

Exception calling "Invoke" with "3" argument(s): "Could not load file or assembly 'file:///P:\Documents\WindowsPowerShell\MappedModules\dbatools\bin\smo\Microsoft.SqlServer.BatchParser.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format."
At line:151 char:5

$scriptBlock.Invoke($script:PSModuleRoot, "$script:DllRoot\smo", ...

CategoryInfo : NotSpecified: (:) [], MethodInvocationException
FullyQualifiedErrorId : CmdletInvocationException

Environmental data

PowerShell:  
Name                           Value                                                                                                                                                                                                                                                                                                                      
----                           -----                                                                                                                                                                                                                                                                                                                      
PSVersion                      5.1.14409.1018                                                                                                                                                                                                                                                                                                             
PSEdition                      Desktop                                                                                                                                                                                                                                                                                                                    
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                                                                                                                                    
BuildVersion                   10.0.14409.1018                                                                                                                                                                                                                                                                                                            
CLRVersion                     4.0.30319.42000                                                                                                                                                                                                                                                                                                            
WSManStackVersion              3.0                                                                                                                                                                                                                                                                                                                        
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                                                                                                                        
SerializationVersion           1.1.0.1
@ACALVETT ACALVETT changed the title DLL error loading DLL error when importing dbatools Mar 12, 2019
@wsmelton
Copy link
Member

@potatoqualitee This is on Windows 7.

@wsmelton wsmelton added bugs life Import Issues associated with importing of the module labels Mar 12, 2019
@potatoqualitee
Copy link
Member

thank you @wsmelton
@ACALVETT - are you running x86 or x64?

@wsmelton
Copy link
Member

@potatoqualitee I can duplicate this with version 0.9.784 on Server 2012 R2 with PowerShell 4.0.

@potatoqualitee
Copy link
Member

UNC or plain ol import too?

@potatoqualitee
Copy link
Member

plz say plain ol cuz i'd have no idea with unc 😅

@wsmelton
Copy link
Member

wsmelton commented Mar 15, 2019 via email

@potatoqualitee
Copy link
Member

why cant i repro?
image

i guess ill just uhh catch it

@wsmelton
Copy link
Member

It was a fresh Azure VM the Windows 2012 R2 DC edition.

potatoqualitee added a commit that referenced this issue Mar 22, 2019
doesn't really matter maybe? works on most?
@potatoqualitee
Copy link
Member

Please try with version 0.9.811, released today. It uses SSMS 2018's SMO 👍

@ACALVETT
Copy link
Contributor Author

ACALVETT commented May 1, 2019

Happy to report that import from UNC works and no more DLL errors when importing with latest build.
Awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs life Import Issues associated with importing of the module
Projects
None yet
Development

No branches or pull requests

3 participants