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

Notification

Icon
Error

Configuration option "Additional files to include" doesn’t work
AlexanderUK
#1 Posted : Friday, February 16, 2018 4:37:21 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/16/2018(UTC)
Posts: 4
Location: Ukraine

Thanks: 2 times
The configuration option “Additional files to include” doesn’t work.

Repro steps:

1. Create three projects: console application, class library and test project.
2. Add into console application project new “appsettings.json” file. And in property page of “appsettings.json” it is necessary to set up “Copy to Output Directory” option as “Copy always”.
3. The class library project has “Method1” which reads settings from “appsettings.json” of console application project.
4. Test project has one test which is testing “Method1” from the class library.
5. Unfortunately, test fails. It happens because “appsettings.json” file isn’t copied to the folder with tests.
6. Even if NCrunch Configuration for Test project has configured option “Additional files to include” as “..\console application\appsettings.json” it doesn’t help.

Each project is builded by NCrunch in separate folder, that’s why there is no possibility to copy files from one project to project with tests. NCrunch copies only exe and dll files into folder with tests.

Visual Studio 2017 version 15.5.6
NCrunch version 3.12.0.15

Can somebody help me with this problem?
Remco
#2 Posted : Friday, February 16, 2018 10:33:53 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,230

Thanks: 691 times
Was thanked: 840 time(s) in 800 post(s)
Hi, thanks for sharing this problem.

This is a technical limitation caused by NCrunch's build optimisations. You need to either change the way this file is located by your code so that it searches relative to the console project's .exe, or you need to turn on the 'Copy referenced assemblies to workspace' setting for the projects involved. See for more information: http://www.ncrunch.net/documentation/considerations-and-constraints_assembly-colocation-assumptions.
1 user thanked Remco for this useful post.
AlexanderUK on 2/16/2018(UTC)
AlexanderUK
#3 Posted : Friday, February 16, 2018 11:23:51 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/16/2018(UTC)
Posts: 4
Location: Ukraine

Thanks: 2 times
Thanks a lot. It really helped. As workaround it works!
Users browsing this topic
Guest (3)
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.024 seconds.