Toad World® Forums

Error when try to add a new SQL Server connection

This issue started happening 2 weeks ago when I tried to open a SQL file.
So I re-install Data Analysts 2.7 and now I tried to add a new SQL Server connection. the following error pops up.
Could you help please? Thanks.

System.IO.FileLoadException
Could not load file or assembly ‘C:\Program Files\Quest Software\Toad for Data Analysts 2.7\Plugins\SqlServer\ToadSqlServer.dll’ or one of its dependencies. Element not found. (Exception from HRESULT: 0x80070490)
Stack Trace:
at System.Reflection.AssemblyName.nGetFileInformation(String s)
at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)
at Quest.Toad.Loading.AssemblyLoader.LoadAssemblies(IEnumerable filenames, Boolean initialize)
at Quest.Toad.Util.Facility.Load()
at Quest.Toad.Util.Facility.get_ImplementationType()
at Quest.Toad.SqlServer.SqlServerProvider.CreateProviderConnection(ConnectMediator mediator)
at Quest.Toad.Db.Provider.BackgroundConnector.CreateBackgroundConnection()

Wow, I haven’t seen that one before.

Please go to your install dir and run the ngenUninstall.bat. Then run the NGenWrapper.exe. You will need to watch the process to see when it is done before restarting. This will reinitialize the gac and create a new toad.config file. These are the main elements that load the files that you are getting an error with.

If this still does not work we will have to look at the dependencies in this dll that maybe missing. But the dependencies were there before…

Debbie

Now it works fine. Thank you.

Any idea why this could happen?

Actually no, I don’t know why this happend. Most likely some other app was installed on your pc that changed the environment. What I had you had you do was a shorter version of reinsatlling the TDA app.

Debbie

It happens again now. When I tried to open a SQL file, the above error pops up and block to run the SQL file.
Could you help please? Thank you.

I would see your IT department. We are trying to get our native image out of the GAC. This is normal .net behavior. Something is preventing us (new policy maybe) or something is messing up the native images in the GAC.

You could try running the ngenuninstall.bat and then running TDA. This takes all of the images out of the GAC. The app will run slower but perhaps this can bypass whatever that is on your system that is trying to prevent us from using the GAC.

Debbie