We can quickly configure Visual Studio so the web.config file is copied (and renamed) from your web project to the NUnit build folder.
Add the web.config File as a Link
- Right click on NUnit project in Visual Studio
Add > Existing Item - Navigate to the web.config file in the web project
- Select the web.config file
click on the arrow beside the Add button > Add As Link
Edit the NUnit Project File
Use a text editor to edit the NUnit project file, you will be able to find the lines where you have added the web.config file.
Change from:
<None Include="..\Other.Project\Web.config">
<Link>Web.config</Link>
</None>
To:
<None Include="..\Other.Project\Web.config">
<Link>Namespace.dll.config</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
This will copy the linked file and rename it so NUnit will find it.
No comments:
Post a Comment