Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

File not found exception
Melle
#1 Posted : Wednesday, July 4, 2012 6:57:33 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/2/2012(UTC)
Posts: 5
Location: Haarlem, the Netherlands


One of the projects has an XML file included in the project which is read.

However, NCrunch is not able to find the file, even in the properties we select to 'copy always' for this particular file.

Here's the exception thrown:

--
System.Exception : Configured DeploymentGroup could not be loaded
----> Haddock.Business.Logging.HaddockException : Could not load DeploymentGroup xml file
----> System.IO.DirectoryNotFoundException : Could not find a part of the path 'C:\Users\mkoning.DEV\AppData\Local\NCrunch\5680\Applications\PollingService\Haddock.Applications.PollingService.Core\xml\DeploymentGroups.xml'.
at Haddock.Applications.PollingService.Core.Poller.GetConfiguredDeploymentGroupFromXmlFile() in D:\Haddock\IdeFix\Sprint10\SL\Applications\PollingService\Haddock.Applications.PollingService.Core\Poller.cs:line 216#0
at Haddock.Applications.UnitTest.PollingService.TestPollingService.PollerTest.GetDeploymentGroups() in D:\Haddock\IdeFix\Sprint10\SL\Applications\PollingService\Haddock.Applications.UnitTest.PollingService\TestPollingService.cs:line 80#1
at Haddock.Applications.UnitTest.PollingService.TestPollingService.GetDeploymentGroupsAndAffiliatesToBeIgnored_SUCCEED() in D:\Haddock\IdeFix\Sprint10\SL\Applications\PollingService\Haddock.Applications.UnitTest.PollingService\TestPollingService.cs:line 42#2
--HaddockException
at Haddock.Business.Services.DeploymentGroups.DeploymentGroupService.ReadDeploymentGroupsFromXml() in D:\Haddock\IdeFix\Sprint10\SL\Business\Haddock.Business.Services\DeploymentGroups\DeploymentGroupService.cs:line 60#3
at Haddock.Applications.PollingService.Core.Poller.GetConfiguredDeploymentGroupFromXmlFile() in D:\Haddock\IdeFix\Sprint10\SL\Applications\PollingService\Haddock.Applications.PollingService.Core\Poller.cs:line 191#4
--DirectoryNotFoundException
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver)
at System.Threading.CompressedStack.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.CompressedStack.Run(CompressedStack compressedStack, ContextCallback callback, Object state)
at System.Xml.XmlTextReaderImpl.OpenUrl()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at Haddock.Business.Services.DeploymentGroups.DeploymentGroupService.ReadDeploymentGroupsFromXml() in D:\Haddock\IdeFix\Sprint10\SL\Business\Haddock.Business.Services\DeploymentGroups\DeploymentGroupService.cs:line 41#5

--

Our assumption is that the xml file (which is included in the PollingService.Core project) should be copied by the NCrunch build process, right?
Remco
#2 Posted : Thursday, July 5, 2012 1:13:44 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,987

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi,

Yes, your assumption is correct. NCrunch should normally identify the file as being a part of the project, and copy it to the workspace so that the tests can run as usual.

It's possible that the markup being used to include this xml file in the .proj isn't being recognised by NCrunch and that it fails to notice the file. Issues such as this were quite common in the early builds of NCrunch and it wouldn't surprise me if there are still some file inclusion methods that NCrunch isn't covering.

Can you share the XML syntax being used to include the file in the .proj file?

You can probably work around this issue by adding a relative path to the file in your 'Additional files to include' NCrunch project-level configuration option for its relevant project.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.036 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download