Code Coverage Error
adam_hafner
Posts: 91 Silver 2
in SQL Test
I am trying to use SQL Test on the test tSQLt database and the tests complete correctly, but the code coverage errors. The error is as follows:
Here are the software versions I am running:
SSMS - 20.2.30.0
SQL Test - 4.1.20.3489
Can you please let me know how to resolve this issue?
Thanks,
--Adam
System.IO.FileLoadException: The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at SQLCover.Parsers.StatementParser.GetChildStatements(String script, Boolean quotedIdentifier) at SQLCover.Source.DatabaseSourceGateway.GetBatches(List`1 objectFilter, List`1 filteredObjects) at SQLCover.CodeCoverage.GenerateResults(List`1 filter, List`1 xml, List`1 filteredObjects) at SQLCover.CodeCoverage.Stop() at RedGate.SQLTest.tSQLt.Cover.SqlCoverTracker.Stop()There was a similar issue reported that @Jon_Kirkwood responded to that required a new version of SQL Test (https://forum.red-gate.com/discussion/89558/code-coverage-error#latest). I have tried uninstalling/reinstalling SQL Test and that had no effect.
Here are the software versions I am running:
SSMS - 20.2.30.0
SQL Test - 4.1.20.3489
Can you please let me know how to resolve this issue?
Thanks,
--Adam
Tagged:
Answers
Thanks for reaching out on the Redgate forum, and sorry to hear this error is occurring for you. I had a look over my old post and can see the dev fix that was done around then. Hopefully this isn't a regression.
I noticed that there was another recent release of SQL Test - before I escalate to the team, can you patch to
V4.1.21 and confirm that the error is still occurring for you
Download link for that version is available here:
https://download.red-gate.com/checkforupdates/SQLTest/SQLTest_4.1.21.3620.exe
Shall escalate and come back via this forum post with any updates as they are made available
Here is one of the forks (https://github.com/sayantandey/SQLServerCoverage)
SQL Test is largely a wrapper for tSQLt and other community driven scripts for unit testing. Our developers focus is primarily on the application itself and the maintenance of the scripts being run is driven by https://tsqlt.org
That being said, SQL Cover is not part of tSQLt, it is a library that is solely used by the application itself, so this doesn't seem like it would have anything to do with the maintainers of tSQLt.
Also, have you heard anything in regards to fixing the code coverage error I was receiving? I know you said you escalated it, but I haven't heard back.
Thanks!
--Adam
Thanks!
--Adam
Hi Adam,
Can you please conduct a complete uninstallation of SQL Test and try a fresh installation of V4.2.1
Download link here:
https://download.red-gate.com/checkforupdates/SQLTest/SQLTest_4.2.1.3759.exe
This has been tested on a similar system (SSMS 20.2.30.0) and is running through tests to display Code Coverage as expected.
As a further check, are you able to look at patching SSMS to a newer version in case there is a DLL conflict occurring. We have referenced a possible conflict that may occur with
Microsoft.SqlServer.TransactSql.ScriptDom
that may be triggering when accessing the Code Coverage tab.This will check your currently installed and the latest GA versions of whatever SSMS you are using.
This will then go to the download page for the latest version which is typically:
https://learn.microsoft.com/en-gb/sql/ssms/download-sql-server-management-studio-ssms