PathTooLongException

PathTooLongException

Hello! Ive run into problems with building codecoverage on my test assemblies. The problem is pretty simple. Im using msbuild task and I really don`t want to develop all my unit tests as one .Net project. This is my script: For start all were looking good. Now when we have created 3rd unit-tests project there is exception: Target CoreBuildNCoverUnitTests: NCover.Console v2.0.4 (x86) - Code Coverage Analysis for .NET Copyright (c) 2003-2007 Gnoso Inc. http://www.ncover.com

Registered to Customer #: 6240
NCover Enterprise Edition (1 User) 

Command: C:\Program Files\MbUnit\MbUnit.Cons.exe
Command Args: C:\p4\PRCHAT\CHaT\main\build\..\tests\unit\PartnerRe.CHaT.Business.Tests\bin\Debug\PartnerRe.CHaT.Business.Tests.dll;C:\p4\PRCHAT\CHaT\main\build\..\tests\unit\PartnerRe.CHaT.BusinessObjects.Tests\bin\Debug\PartnerRe.CHaT.BusinessObjects.Tests.dll;C:\p4\PRCHAT\CHaT\main\build\..\tests\unit\PartnerRe.CHaT.SqlClr.Tests\bin\Debug\PartnerRe.CHaT.SqlClr.Tests.dll
Working Directory: 
Assemblies: 

******************* Program Output *******************
Parsed arguments:
-- Parsed Arguments
Files:
    C:\p4\PRCHAT\CHaT\main\build\..\tests\unit\PartnerRe.CHaT.Business.Tests\bin\Debug\PartnerRe.CHaT.Business.Tests.dll;C:\p4\PRCHAT\CHaT\main\build\..\tests\unit\PartnerRe.CHaT.BusinessObjects.Tests\bin\Debug\PartnerRe.CHaT.BusinessObjects.Tests.dll;C:\p4\PRCHAT\CHaT\main\build\..\tests\unit\PartnerRe.CHaT.SqlClr.Tests\bin\Debug\PartnerRe.CHaT.SqlClr.Tests.dll
Assembly paths:
Report folder: 
Report Name Format: mbunit-{0}{1}
Report types:
Show reports: False
Filter Category: 
Exclude Category: 
Filter Author: 
Filter Namespace: 
Filter Type: 
Verbose: False
ShadowCopyFiles: False

Start time: 4:00 PM
[info] Loading test assemblies
System.ApplicationException: Failed loading assemblies ---> System.ApplicationException: Failed loading TestDomain ---> System.Exception: Failed loading assembly ---> System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
   at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck)
   at System.IO.Path.GetFullPathInternal(String path)
   at System.IO.Path.GetFullPath(String path)
   at MbUnit.Core.Remoting.TestDomain.CheckTestFile()
   at MbUnit.Core.Remoting.TestDomain.CreateDomain()
   at MbUnit.Core.Remoting.TestDomainBase.InitializeEngine()
   --- End of inner exception stack trace ---
   at MbUnit.Core.Remoting.TestDomainBase.InitializeEngine()
   at MbUnit.Core.Remoting.TestDomainBase.Load()
   --- End of inner exception stack trace ---
   at MbUnit.Core.Remoting.TestDomainBase.Load()
   at MbUnit.Core.Graph.TestDomainDependencyGraph.AddDomain(TestDomainBase domain)
   at MbUnit.Core.Graph.TestDomainDependencyGraph.BuildGraph(String[] testAssemblies, String[] assemblyPaths, IFixtureFilter fixtureFilter, IRunPipeFilter runPipeFilter, Boolean verbose)
   --- End of inner exception stack trace ---
   at MbUnit.Core.Graph.TestDomainDependencyGraph.BuildGraph(String[] testAssemblies, String[] assemblyPaths, IFixtureFilter fixtureFilter, IRunPipeFilter runPipeFilter, Boolean verbose)
   at MbUnit.Core.Graph.TestDomainDependencyGraph.BuildGraph(String[] testAssemblies, String[] assemblyPaths, IFixtureFilter fixtureFilter, Boolean verbose)
   at MbUnit.Core.Cons.MainClass.Main()
***************** End Program Output *****************

Execution Time: 00:00:00.5624964s

Any ideas how to avoid this? One solution could be running NCover on every assembly separately, but I need metrics on all unit tests. So for that I could run NCoverExplorer task but I suppose there will be similar exception when I`ll add to arguments all my .xml results. Now NCover starts to show his bad sides. Please help!


RE: PathTooLongException

narcomancer,

it looks like you're passing in the test assemblies as a list of items separated by semicolons when mbunit expects them to be separated by spaces. try replacing the semicolons in your test assembly list with spaces.

Stephen


RE: PathTooLongException

sporewell,

Thank You, this helped me much. I`ve created new msbuild task which converts item to property with specific delimiter so I have working automated codecoverage again!