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

2017 Error Enumerating Database - Could not load file or assembly #17

Closed
lowerider21 opened this issue Jun 6, 2018 · 7 comments
Closed
Assignees

Comments

@lowerider21
Copy link

I am receiving the following error message when trying to scan a SQL Server 2017 (with a 2017 Repo). I have tried this on two machines and I am getting the same error on both (windows 10 machines). The 2014 and 2016 analyzer worked fine. I tried in the GUI and command line and received the error both places. I have SSMS 17.7 installed locally. I googled the error for a while thinking it was my local but than tried on a second machine.
Unexpected error occurred: Could not load file or assembly 'Microsoft.SqlServer.Smo, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
Stack Trace:
at Microsoft.Samples.DependencyAnalyzer.SQLDBEnumerator.EnumerateDatabase(String dbConnection, Boolean storeThreePartNames)
at Microsoft.Samples.DependencyAnalyzer.Program.EnumerateDatabase(DependencyArguments dependencyArguments, Repository repository)
at Microsoft.Samples.DependencyAnalyzer.Program.Main(String[] args)

@keif888 keif888 self-assigned this Jun 7, 2018
@keif888
Copy link
Owner

keif888 commented Jun 7, 2018

Prior to SQL Server 2017 the SMO objects were deployed as part of other installs, or as a separate MSI. For SQL Server 2017, they were changed to a NuGet package as per https://docs.microsoft.com/en-us/sql/relational-databases/server-management-objects-smo/installing-smo?view=sql-server-2017. and have to be deployed as part of the software package. I was unaware of this prior to today.

Release Beta 0.23.0.0 should correct this issue:
https://github.com/keif888/SQLServerMetadata/releases

keif888 added a commit that referenced this issue Jun 7, 2018
@lowerider21
Copy link
Author

I hate to be a pain but that MSI will not execute and install on my machine. It just sits. I restarted a few times, tried installing as Admin, as another user, etc. So far I get nothing. I tried on another machine and it did install there so I am not sure what the issue is. When i tried to enumerate a database though i now get this issue. CLR is installed for 2017 on that machine.
Could not enumerate the database: Could not load file or assembly 'Microsoft.SqlServer.SqlClrProvider, Version=14.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

@keif888
Copy link
Owner

keif888 commented Jun 8, 2018

The MSI is installing without issues on my development and test machines, although SmartScreen is kicking in as it's a new msi file that hasn't been "seen".

I packaged the MSI file with only the DLL's that are referenced in the project, but it appears that some others are being dynamically linked in. I will add all the DLL's included in the NuGet package to attempt to ensure there are no other issues of the missing DLL type.

@lowerider21
Copy link
Author

Good news and bad news. The enumerating of the database is now running. However three specific issues.

  1. The data from the scan is not being written to the repository database. The object and RunScan tables are blank. No errors showing up to indicate there is an issue. Repo is on a 2017 server.
  2. The error below occurred when trying to scan a SSIS 2017 Catalog.
  3. When it was scanning .dtproj it would hang on one of my solutions. I have no error message or log, it just hung. It must be something about that particular project cause it was able to scan others. This is more an FYI at this point.
    Sorry to bring more bad news.

Error message for issue 2.
Enumerating Integration Services metadata.
Unexpected error occurred: GenericArguments[0], 'Microsoft.SqlServer.Management.IntegrationServices.Catalog', on 'Microsoft.SqlServer.Management.Sdk.Sfc.SfcCollection`3[T,K,ParentT]' violates the constraint of type parameter 'T'.
Stack Trace:
at Microsoft.Samples.DependencyAnalyzer.SSISEnumerator.EnumerateSqlPackages(String server, String user, String pwd, String[] rootFolders, Boolean storeThreePartNames, String[] storePackagePasswords)
at Microsoft.Samples.DependencyAnalyzer.Program.EnumerateSSIS(DependencyArguments dependencyArguments, Repository repository)
at Microsoft.Samples.DependencyAnalyzer.Program.Main(String[] args)

@keif888
Copy link
Owner

keif888 commented Jun 11, 2018

I have split the three issues mentioned above out into separate issues, so I can track the fixes against them.
#18, #19, and #20.
Could you please, if possible, upload the solution that causes the hang against #20?
Or maybe just the SSIS package?

@lowerider21
Copy link
Author

I will look where it failed and what I can upload. I do know there are third party add ins (Pragmatic Works Task Factory) Components in the solution that failed.

@keif888
Copy link
Owner

keif888 commented Jun 15, 2018

2 of three issues above have been addressed in latest release.
The data from scan one I am unable to replicate.
Closing this issue, as the others now track them.

@keif888 keif888 closed this as completed Jun 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants