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

Install not working for SSMS v18.4 #13

Open
jaka891 opened this issue Feb 26, 2020 · 2 comments
Open

Install not working for SSMS v18.4 #13

jaka891 opened this issue Feb 26, 2020 · 2 comments

Comments

@jaka891
Copy link

jaka891 commented Feb 26, 2020

Tried to install it using the installer and manually but the extension does not seem to be loaded.

My SSMS version is the following:
SQL Server Management Studio 15.0.18206.0
Microsoft Analysis Services Client Tools 15.0.1567.0
Microsoft Data Access Components (MDAC) 10.0.18362.1
Microsoft MSXML 3.0 6.0
Microsoft Internet Explorer 9.11.18362.0
Microsoft .NET Framework 4.0.30319.42000
Operating System 10.0.18363

@shaunek
Copy link

shaunek commented Jun 20, 2020

I have SSMS v18.5 and I have also attempted to install "SSMS Executor v2.0.3-alpha" by zip file and exe without success.

Zip file issue
I get the "The 'ExecutorPackage' package did not load correctly" error as described on the Known Issues page. If I click No and restart it doesn't work still (I don't see Execute Statement, etc in the Tools menu).

SQL Server Management Studio 15.0.18330.0
SQL Server Management Objects (SMO) 16.100.37971.0
Microsoft Analysis Services Client Tools 15.0.19040.0
Microsoft Data Access Components (MDAC) 10.0.17763.1
Microsoft MSXML 3.0 6.0
Microsoft .NET Framework 4.0.30319.42000
Operating System 10.0.17763

Here is the last content from C:\Users\me\AppData\Roaming\Microsoft\AppEnv\15.0\ActivityLog.xml:

  <entry>
    <record>277</record>
    <time>2020/06/20 11:24:32.277</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Begin package load [ExecutorPackage]</description>
    <guid>{A64D9865-B938-4543-BF8F-A553CC4F67F3}</guid>
  </entry>
  <entry>
    <record>278</record>
    <time>2020/06/20 11:24:32.282</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>CreateInstance failed for package [ExecutorPackage]Source: &apos;mscorlib&apos; Description: Could not load file or assembly &apos;file:///c:\program files (x86)\microsoft sql server management studio 18\extensions\ssmsexecutor\SSMSExecutor.dll&apos; or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)&#x000D;&#x000A;System.IO.FileLoadException: Could not load file or assembly &apos;file:///c:\program files (x86)\microsoft sql server management studio 18\extensions\ssmsexecutor\SSMSExecutor.dll&apos; or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)&#x000D;&#x000A;File name: &apos;file:///c:\program files (x86)\microsoft sql server management studio 18\extensions\ssmsexecutor\SSMSExecutor.dll&apos; ---&gt; 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.&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark&amp; stackMark)&#x000D;&#x000A;   at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence securityEvidence)&#x000D;&#x000A;   at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)&#x000D;&#x000A;   at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)&#x000D;&#x000A;&#x000D;&#x000A;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.</description>
    <guid>{A64D9865-B938-4543-BF8F-A553CC4F67F3}</guid>
    <hr>80004005 - E_FAIL</hr>
    <errorinfo></errorinfo>
  </entry>

I read this error message and decided to try editing SSMExecutor.dll.config file to see if that would make a difference (per Microsoft article), but it didn't change anything. Here is what I added to the config file:

  <runtime>
      <loadFromRemoteSources enabled="true"/>
   </runtime>

I am on a corporate PC with some restrictions, and although most of the time I am able to install software as administrator, could have something to do with my problem. The thing is that I have the extension working beautifully in SSMS 2016. Here is my SSMS 2016 info:

Microsoft SQL Server Management Studio 13.0.16106.4
Microsoft Analysis Services Client Tools 13.0.1700.441
Microsoft Data Access Components (MDAC) 10.0.17763.1
Microsoft MSXML 3.0 6.0
Microsoft Internet Explorer 9.11.17763.0
Microsoft .NET Framework 4.0.30319.42000
Operating System 6.3.17763

Exe issue
Slightly different from jaka891 I was unable to even execute installer version. When I try to run the .exe I get an error "Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item." I did check some basic permissions things such as making sure it is unblocked and my user has full control of the exe, but I'm not sure what else do do. I'm not too concerned about this as I think it is likely that something with the corporate restrictions is funky here. Mainly wishing the zip file method worked!

@wavecentral
Copy link

wavecentral commented Aug 10, 2020

When you downloaded the zip, windows designates the extracted files as having been downloaded from the internet and in .NET 4 framework, it causes these to not be loaded.

You can work around the issue by changing the file properties:

  • Open file explorer and navigate to where you have the dll
  • Right-click on dll and select properties
  • Under "General" you will only see a "Security: This file came from another computer..." with a unselected check box named "Unblock". Check the box and click apply, then ok.
  • Restart SSMS and all should be good. No config file changes needed.

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

3 participants