nicholas-ross / SSMS-Schema-Folders

This an extension for SQL Server Management Studio (SSMS). It groups sql objects in Object Explorer (tables, views, etc.) into schema folders.
GNU General Public License v2.0
159 stars 34 forks source link

Extension does not load in SMS Management Studio 18.4 #14

Open github-clearthought opened 4 years ago

github-clearthought commented 4 years ago

error screen shot: https://imgur.com/cXS5MXu

I deleted the activity.xml to see only the relevant error, but now it won't recreate. It said something to the effect of "appId will not run". It did not give an app ID, but actually said "appId".

ClarkJeff commented 4 years ago

Here's the ActivityLog.xml error:

819 Error VisualStudio CreateInstance failed for package [SsmsSchemaFolders.SsmsSchemaFoldersPackage, SsmsSchemaFolders, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a93ca1bbf74c67b4]Source: 'mscorlib' Description: Could not load file or assembly 'file:///c:\program files (x86)\microsoft sql server management studio 18\common7\ide\extensions\ssms schema folders\SsmsSchemaFolders.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) System.IO.FileLoadException: Could not load file or assembly 'file:///c:\program files (x86)\microsoft sql server management studio 18\common7\ide\extensions\ssms schema folders\SsmsSchemaFolders.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) File name: 'file:///c:\program files (x86)\microsoft sql server management studio 18\common7\ide\extensions\ssms schema folders\SsmsSchemaFolders.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information. at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence securityEvidence) at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo) at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName) System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information. {A88A775F-7C86-4A09-B5A6-890C4C38261B}
80004005 - E_FAIL
github-clearthought commented 4 years ago

Thanks to ClarkJeff's comment, I was able to find a solution. Go to the folder were you copied the SSMS Schema Folder DLL files, for example, "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Extensions\SSMS Schema Folders".

Select the first DLL file and press Ctrl+Enter to bring up the file property dialog. Click the button labeled "Unblock". Repeat for each DLL. You can't multi-select and do this because Microsoft.

Then restart SSMS. The DLLs will load now and the extension will work.

I would suggest writing a batch or a PowerShell script to figure out the right directory, copy the files, and unblock the files.

github-clearthought commented 4 years ago

https://i.ibb.co/hdmjv7c/ss.png

donvnielsen commented 4 years ago

I'm running SSMS 18.5. I right-clicked SsmsSchemaFolders.dll and unblock it. In the image below, ignore that it shows Ssms2012.dll. I just want to illustrate where [ ] Unblock was located in the properties window.

image

Works good. Brings the old dog SSMS closer to be being efficient for users.

immiz commented 1 year ago

https://github.com/nicholas-ross/SSMS-Schema-Folders/issues/23#issue-977152792

As JoshFerguson mentioned here, it can be done with Powershell: get-childitem "path/to/your/extracted/extension/folder" | unblock-file