wakatime / ssms-wakatime

SQL Server Management Studio plugin to quantify your coding with automatic time tracking and metrics about your programming. https://wakatime.com
BSD 3-Clause "New" or "Revised" License
41 stars 19 forks source link

The WakaTimePackage package did not load correctly #31

Closed alanhamlett closed 10 months ago

alanhamlett commented 2 years ago
SSMS 18 version: 2019.150.18390.0 (Microsoft Visual Studio 2017 version: 15.0.28307.421)

CreateInstance failed for package [WakaTimePackage]Source: 'mscorlib' Description: Could not load file or assembly 'file:///c:\program files (x86)\microsoft sql server management studio 18\common7\ide\extensions\wakatime.v18\WakaTime.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\wakatime.v18\WakaTime.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\wakatime.v18\WakaTime.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.

not-night-but commented 2 years ago

Any updates on fixing this? The extension fails to load every time I start SSMS

mabubakarriaz commented 2 years ago

Having same issue. which .net framework is need to run this extension?

odskee commented 2 years ago

Was running into the same issue; error directed to https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/ee890038(v=vs.100)?redirectedfrom=MSDN

If you run into this problem, you need open the WakaTime.v18 directory within SMSS Extensions and make sure all files have been unblocked (right click -> properties). Then start SMSS as Admin, you can enter the API key from Tools -> WakaTime -> Settings but should be set if already using VS.

webmasterrm commented 1 year ago

Was running into the same issue; error directed to https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/ee890038(v=vs.100)?redirectedfrom=MSDN

If you run into this problem, you need open the WakaTime.v18 directory within SMSS Extensions and make sure all files have been unblocked (right click -> properties). Then start SMSS as Admin, you can enter the API key from Tools -> WakaTime -> Settings but should be set if already using VS.

This solution works for me! :-)

ricardosuab93 commented 1 year ago

Was running into the same issue; error directed to https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/ee890038(v=vs.100)?redirectedfrom=MSDN

If you run into this problem, you need open the WakaTime.v18 directory within SMSS Extensions and make sure all files have been unblocked (right click -> properties). Then start SMSS as Admin, you can enter the API key from Tools -> WakaTime -> Settings but should be set if already using VS.

That works for me too

michasacuer commented 1 year ago

@odskee what do you mean by properties -> unblock?

odskee commented 1 year ago

@michasacuer In Windows File Explorer, you navigate to the actual WakaTime directory - select one or more, right click and properties and you'll likely see an option at the bottom to unblock (it's a tick box). You'll often have this with downloaded files, just something to be aware of.

gandarez commented 1 year ago

Despite the error I launched a new version today please check it out https://github.com/gandarez/ssms-wakatime/releases/tag/v4.0.0

alanhamlett commented 10 months ago

Closing for now. Let us know if this is still not working and we can help debug it.