Home Dashboard Directory Help

SQL Server Data Tools Unit Tests error: System.ArgumentNullException: Value cannot be null. by lk425


 as Not Reproducible Help for as Not Reproducible

Sign in
to vote
Type: Bug
ID: 800203
Opened: 9/10/2013 8:48:11 PM
Access Restriction: Public
User(s) can reproduce this bug



I am trying to write SQL Server unit tests using SQL Server Data Tools. I have a solution with a SQL 2012 database project in it. It builds with no errors. I then open SQL Server Object Explorer, navigate to the projects section, and try to create unit tests for some stored procedures, as suggested in the msdn blog (http://blogs.msdn.com/b/ssdt/archive/2012/12/07/getting-started-with-sql-server-database-unit-testing-in-ssdt.aspx). I leave all the defaults for the tests and recompile - no errors. Then I open the test explorer. No tests are visible. I recompile the solution and get this error:
System.ArgumentNullException: Value cannot be null.
Parameter name: source
at Microsoft.VisualStudio.Shell.ValidateArg.NotNull[T](T arg, String parameterName)
at Microsoft.VisualStudio.Shell.ValidateArg.NotNullOrEmpty[T](IEnumerable`1 arg, String parameterName)
at Microsoft.VisualStudio.Shell.Interop.VSProjectExtensions.CompareNormalizedPath(String source, String target)
at Microsoft.VisualStudio.Shell.Interop.VSProjectExtensions.GetKeyOutputForIVsOutputGroup(IVsOutputGroup outputGroup)
at Microsoft.VisualStudio.Shell.Interop.VSProjectExtensions.GetProjectOutputPath(IVsProjectCfg2 projectConfig, String groupName)
at Microsoft.VisualStudio.Shell.Interop.VSProjectExtensions.GetKeyOutputForGroup(IVsSolutionBuildManager buildManager, IVsProject project, String groupName)
at Microsoft.VisualStudio.TestWindow.VsAdapters.VsTestContainer.get_Source()
at Microsoft.VisualStudio.TestWindow.VsAdapters.VsTestContainer.CreateTimeStamp()
at Microsoft.VisualStudio.TestWindow.VsAdapters.VsTestContainer..ctor(ITestContainerDiscoverer discoverer, ILogger log, IVsProject project, IServiceProvider serviceProvider, IVsAppContainerUtilities appContainerUtilities)
at Microsoft.VisualStudio.TestWindow.VsAdapters.VsProjectOutputContainerDiscoverer.<get_TestContainers>b__0(IVsProject p)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Microsoft.VisualStudio.TestWindow.Controller.TestContainerDiscovererExtension.GetSortedContainers(ITestContainerDiscoverer discoverer)
at Microsoft.VisualStudio.TestWindow.Controller.TestContainerProvider.GetContainersFromDiscoverer(ITestContainerDiscoverer discoverer)

If I close and reopen Visual Studio, it immediately comes up with the same error in the output window. It seems to be related to the Test Explorer being open.

I am on the latest builds of all SQL Server Data tools products, verified by going to the SQL menu and selecting "Check for updates". SQL Server Data Tools build 11.1.30822.0. Operating system is Windows 8 Enterprise.

UPDATE: this now works in SSDT build 11.1.30914.0
Sign in to post a comment.
Posted by Richard Pope on 10/23/2013 at 3:35 AM
I'm also getting this with the latest version of SSDT
Posted by jonesri on 10/4/2013 at 4:34 AM
I have upgraded to the latest version of SSDT (11.1.30914.0) and still get this error. If I remove the Integration Services Project the problem disappears.

Is anyone else still getting the problem?
Posted by Microsoft on 9/24/2013 at 4:43 PM
It seems this issue has resolved itself for you in the most recent build? Due to this I'm planning on closing the bug we had to track this. Thanks for your feedback!

Sign in to post a workaround.
Posted by lk425 on 9/19/2013 at 11:00 PM
Fixed in build 11.1.30914.0