Could not load file or assembly - sql

I am using aws lamda function to connect my database and execute sql script file but whenever I run my project I am getting same error
I am getting this error in Lamda Mock Test Tool
Can anyone help me out..?Please let me know
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.ConnectionInfo, Version=16.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'. The system cannot find the file specified.
at AwsLamdaDb.Function.FunctionHandler(String input, ILambdaContext context)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at AwsLamdaDb.Function.FunctionHandler(String input, ILambdaContext context)
---------------- Inner 1 Exception ------------
System.IO.FileNotFoundException: Could not load the specified file.
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName)
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)

I am not .NET resource, though I think this is due to improper installation of SQL Server SDK Assemblies. Can you check if the SQL Server SDK is installed or not?
Refer: https://social.msdn.microsoft.com/Forums/ie/en-US/896e04a7-d5b0-41bf-a846-eb69dc5cc06a/microsoftsqlserverconnectioninfo-load-error?forum=adodotnetdataproviders

Related

Why is OneDrive Deleting My Project Files Causing Error System.InvalidOperationException?

It seems as though OneDrive somehow kept deleting my files from my project (that I REALLY NEED!) & now my project keeps throwing errors saying that This all happens when I go to run the program in DEBUG. I have missing files as shown in the image below:
System.InvalidOperationException
HResult=0x80131509
Message=An error occurred creating the form. See Exception.InnerException for details. The error is: Could not load file or assembly 'MySql.Data, Version=8.0.30.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.
Source=eBayKeywordSniperPro
StackTrace:
at eBayKeywordSniperPro.My.MyProject.MyForms.Create__Instance__[T](T Instance)
at eBayKeywordSniperPro.My.MyProject.MyForms.get_FormSelector()
at eBayKeywordSniperPro.My.MyApplication.OnCreateMainForm()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at eBayKeywordSniperPro.My.MyApplication.Main(String[] Args)
Inner Exception 1:
FileNotFoundException: Could not load file or assembly 'MySql.Data, Version=8.0.30.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.
I have disconnected OneDrive because I feel like they are stealing my data/files and then charging me for additional storage. If I didn't pay Microsoft, then they won't allow me to retrieve the data. That's shady.
Anyhow, I don't see any options to use the "Nuget Installation" to download the dependencies or necessary files that the project needs to run.
How do I make sure that the files remain in the proper folders after disconnecting from Microsoft's OneDrive? Thanks.

SSIS cannot load script for execution when click on edit script and build

For some reason my SSIS script task in control flow and SSIS script component in data flow not working. If I drop an empty script and click on start it executes. But if I click on edit script and write simple code like
int a=10;
and click on build build is succeeded but when I click on start fails the package execution.
I tried with SSDT with visual studio 2017 and SSIS with Visual Studio 2019
with cannot load the script message as below for script task.
For script component in data flow task it throws the below error:-
System.IO.FileLoadException: Could not load file or assembly '15872 bytes loaded from Microsoft.SqlServer.TxScript, Version=15.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. Exception from HRESULT: 0xD0000003
File name: '15872 bytes loaded from Microsoft.SqlServer.TxScript, Version=15.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' ---> System.Runtime.InteropServices.COMException (0xD0000003): Exception from HRESULT: 0xD0000003
at System.Reflection.RuntimeAssembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection, Boolean fSkipIntegrityCheck, SecurityContextSource securityContextSource)
at System.Reflection.Assembly.Load(Byte[] rawAssembly)
at Microsoft.SqlServer.Dts.Pipeline.VSTAComponentScriptingEngine.GetScriptEntryPoint(String versionGuid)
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.CreateUserScriptInstance()
There is an issue in Visual studio that caused the error. Here is the latest fix posted by Microsoft on there website https://marketplace.visualstudio.com/items?itemName=SSIS.SqlServerIntegrationServicesProjects&ssr=false#overview
enter image description here

SolrNET Ninject Integration Error- Could not load file or assembly 'HttpWebAdapters'

I had successfully implemented Solrnet using Ninject Integration. However it suddenly started failing yesterday giving the following error.
Could not load file or assembly 'HttpWebAdapters, Version=0.4.0.2002, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Here is the stack trace:
[FileNotFoundException: Could not load file or assembly 'HttpWebAdapters, Version=0.4.0.2002, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.]
SolrNet.Impl.SolrConnection..ctor(String serverURL) +0
Ninject.Integration.SolrNet.SolrNetModule.Load() in c:\Users\kanja-1\Documents\Visual Studio 2012\Projects\Ninject.Integration.SolrNet\Ninject.Integration.SolrNet\SolrNetModule.cs:205
Ninject.Modules.NinjectModule.OnLoad(IKernel kernel) in c:\Projects\Ninject\ninject\src\Ninject\Modules\NinjectModule.cs:85
Ninject.KernelBase.Load(IEnumerable1 m) in c:\Projects\Ninject\ninject\src\Ninject\KernelBase.cs:217
Ninject.KernelBase..ctor(IComponentContainer components, INinjectSettings settings, INinjectModule[] modules) in c:\Projects\Ninject\ninject\src\Ninject\KernelBase.cs:100
Ninject.KernelBase..ctor(INinjectModule[] modules) in c:\Projects\Ninject\ninject\src\Ninject\KernelBase.cs:57
Ninject.StandardKernel..ctor(INinjectModule[] modules) in c:\Projects\Ninject\ninject\src\Ninject\StandardKernel.cs:46
MealsToGo.App_Start.NinjectWebCommon.CreateKernel() in c:\Users\kanja-1\Documents\Visual Studio 2012\Projects\MealsToGo\MealsToGo\App_Start\NinjectWebCommon.cs:53
Ninject.Web.Common.Bootstrapper.Initialize(Func1 createKernelCallback) in c:\Projects\Ninject\Ninject.Web.Common\src\Ninject.Web.Common\Bootstrapper.cs:50
MealsToGo.App_Start.NinjectWebCommon.Start() in c:\Users\kanja-1\Documents\Visual Studio 2012\Projects\MealsToGo\MealsToGo\App_Start\NinjectWebCommon.cs:34
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
Does someone know what I need to do to fix this?
thanks

Where to find the System.management dll

I am trying to build an SQL CLR stored procedure that references an IBM WebSphere MQ dll. I'm having problems doing this on my work machine, so I decided to see if I could just get this to work on my home comp using localhost. I've made progress in getting a different error, however I'm not sure where the system.management dll is located...
Here is a copy of the error message:
Msg 10301, Level 16, State 1, Line 1 Assembly 'amqmdnet' references assembly 'system.management, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request.
This is installed in GAC, Check the version of .Net that you have it on your system
You must register this assembly in SQL Server
create assembly [System.Management]
from 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Management.dll'
with permission_set = unsafe

dll not loading- FileLoadException

The problem I am having is that I am getting a System.IO.FileLoadException when trying to load the RWLock.dll on a test box and Windows xp machines.
This is the exception that is thrown when it tries to load the dll on the windows 2003 server machine (most likely 32 bit):
System.IO.FileLoadException: A procedure imported by 'rwlock, Version=1.0.3889.27926, Culture=neutral, PublicKeyToken=null' could not be loaded.
File name: 'rwlock, Version=1.0.3889.27926, Culture=neutral, PublicKeyToken=null' ---> System.Runtime.InteropServices.COMException (0x8007007F): The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)...
However, we have not had any problems trying to run this on a Windows 2007* server machine (64 bit).
Any ideas? Thanks in advance :)
*windows 2008(oops)
The error message is telling you that RWLock.dll tries to import a function that doesn't exist from another DLL. This probably means that RWLock is trying to import an API function that exists on the (I presume you meant instead of "Windows 2007 Server") Windows 2008 Server machine, but not on Windows 2003 or earlier.
You can use Dependency Walker to figure out what it's trying to load and where it's trying to find that missing function, but it won't help make it available on the Windows versions where it doesn't exist.
The other possibility is that RWLock has a dependency on another DLL that it provides, but you're not re-distributing it properly. Dependency Walker can help with this, too.