Content file not copied to out folder of a Testrun

F

Frank Munsberg

Hi there,

I'm trying to have a content file from an assembly copied to the \Out
directory of a Testrun in VS 2008 (SP1).
The file is marked as content and set to always copy to output directory
like usual. When I build the project, the file is copied to the bin\Debug
folder of the Unit test project. Unfortunately it doesn't get copied to the
\Out directory of the running Test so its missing during the test run.

I'm pretty sure I'm missing something obvious here, how can I get that
content file copied over?

Greets
Frank
 
R

RobinDotNet

Can't the test run look in the \bin\debug folder? If not, then maybe you
could use a post-build command to copy it to the \out folder.

RobinS.
GoldMail.com
 
F

Frank Munsberg

Hi Robin,
Can't the test run look in the \bin\debug folder? If not, then maybe you
could use a post-build command to copy it to the \out folder.

For this one it has to be some relative path due to specifications sadly.

The post build commands you mentioned have only things like $(TargetPath) or
so but that doesn't get me in the folder of the current test run.

Right now I made some File.Copy during the test initialization that copies
the file over while running the current test. It works but I'd call this a
hack since the original project setup clearly tells VisualStudio to copy the
file over on its own.

I'm glad I don't have to deal with lots of content files like on an
NHibernate enabled project. Then I'd have switched back to NUnit for sure.
Is there no way to have these content files being copied as expected?

Greets
Frank
 
S

sunil raju

It's actually need to tell the test project to copy data files along with the rest of your application to the out folder.

You need to right-click on your solution (not your project), choose add, create a new test run configuration. Then you need to edit the test run configuration and specify which files will be copied to the test execution folder.

for more information read.

http://msdn.microsoft.com/en-us/library/ms182480(VS.80).aspx



Posted as a reply to:

Content file not copied to out folder of a Testrun

Hi there

I'm trying to have a content file from an assembly copied to the \Out
directory of a Testrun in VS 2008 (SP1)
The file is marked as content and set to always copy to output directory
like usual. When I build the project, the file is copied to the bin\Debug
folder of the Unit test project. Unfortunately it doesn't get copied to the
\Out directory of the running Test so its missing during the test run

I'm pretty sure I'm missing something obvious here, how can I get that
content file copied over

Greet
Frank

EggHeadCafe - Software Developer Portal of Choice
WCF Workflow Services Using External Data Exchange
http://www.eggheadcafe.com/tutorial...a-6dafb17b6d74/wcf-workflow-services-usi.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top