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

Notification

Icon
Error

Problem with Additional Files to Include
dagilleland
#1 Posted : Monday, January 14, 2013 1:43:27 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/11/2013(UTC)
Posts: 1
Location: Canada

Hi,

I'm evaluating nCrunch, and I'm having a bit of a problem with the Additional Files to Include. It doesn't seem to be pulling in the directories I want when the directory has a relative path that goes outside the project. Note that I am not referencing to get assemblies, per se, but to get a "sister project" (a project that sits alongside my testing project). Any insight you can offer would be appreciated!

Specifically, the line that doesn't seem to be working is this:

Code:
  <AdditionalFilesToInclude>\**.*;..\MyWebApplication\**.*</AdditionalFilesToInclude>


Essentially, I'm writing a solution to test customized build scripts in another project. My folder structure looks like this.
- Solution Folder
- - CustomBuildScript.Specifications
- - MyWebApplication


Here's my complete project ncrunch configuration file:

Code:
<ProjectConfiguration>
  <CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
  <ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing>
  <PreloadReferencedAssemblies>true</PreloadReferencedAssemblies>
  <AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking>
  <AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
  <IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely>
  <RunPreBuildEvents>true</RunPreBuildEvents>
  <RunPostBuildEvents>true</RunPostBuildEvents>
  <PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
  <InstrumentAssembly>true</InstrumentAssembly>
  <PreventSigningOfAssembly>false</PreventSigningOfAssembly>
  <AnalyseExecutionTimes>true</AnalyseExecutionTimes>
  <IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
  <DefaultTestTimeout>60000</DefaultTestTimeout>
  <UseBuildConfiguration></UseBuildConfiguration>
  <UseBuildPlatform></UseBuildPlatform>
  <ProxyProcessPath></ProxyProcessPath>
  <UseCPUArchitecture>AutoDetect</UseCPUArchitecture>
  <IgnoredTests>
    <RegexTestSelector>
      <RegularExpression>DNNModuleBuildScript\.Specifications\.DebugBuildStory\..*</RegularExpression>
    </RegexTestSelector>
    <RegexTestSelector>
      <RegularExpression>DNNModuleBuildScript\.Specifications\.ReleaseBuildStory\..*</RegularExpression>
    </RegexTestSelector>
  </IgnoredTests>
  <AdditionalFilesToInclude>\**.*;..\MyWebApplication\**.*</AdditionalFilesToInclude>
</ProjectConfiguration>
Remco
#2 Posted : Monday, January 14, 2013 10:56:09 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for posting!

Generally I would recommend against using the Additional Files To Include setting to reference files that belong to an adjacent project. Referencing files across projects breaks project atomicity and can create complex arrangements introducing issues that can be hard to track down. As the files are effectively owned by another project, the best practice is to reference this project from your test and use the location of it's built assembly inside the NCrunch test environment in order to find the files you need. There's an example of this that you might want to have a look at in the documentation.

Something else I often try to warn against is using broad wildcards in the 'Additional Files To Include' setting that may accidentally pick up files that are derived from the build process. You'll notice that when you do this, every time you build your solution, NCrunch will automatically kick off its own build. These wildcards can also result in abnormal runtime assembly referencing behaviour that can create some very obscure issues. A better approach is to try and include the necessary files in your project file, or use a more granular approach with the 'Additional files to include' so that the files derived from the build process (i.e. in bin\debug) are not included.

Checking the syntax shown above, it looks as though there is a bug with the configuration dialog used to set up the 'Additional files to include' setting. When choosing the directory containing the project, it will specify a syntax of '\**.*', which is basically trying to include all the files from your root directory upwards. The correct syntax is actually '**.*'. You can work around this by altering the config file you've shown above and specifying the correct syntax. I'll make a note to include a fix for this in an upcoming release. Thanks for reporting this problem!


Cheers,

Remco
Remco
#3 Posted : Saturday, March 30, 2013 10:09:48 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
For anyone interested, a fix for the above described configuration problem ('\**.*') has been introduced with the newly released version of NCrunch (v1.45).
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.040 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download