Problem:
Do debugging in VS2010, the log file can be output.
But, when i use "MSTest.exe" to run the "testmethod", get no logs.
Solution:
1. Add the config files on log4net to the path contain assemblies that you want to run with "MSTest.exe"
2. "Enable Deployment" in Local.testsettings
3. Add attribute "DeploymentItem" to TestMethod.
I fix problem with solution #1 and #2.
I am not very clear on #3.
Will do researching on #3 later.
Also, we can get some information on this:
"
All three answers are correct, depending on your needs.
Adding files to deploy in the .testrunconfig (.testsettings in VS2010) will copy all of those files to every test output folder, even for unrelated tests run in isolation. If you run one test, all the test data files listed in the deployment section of .testssettings will be copied to the test output folder.
In my tests I need to copy an expected XML file to the test output folder to compare with the actual test output XML. I use the DeploymentItem attribute to only copy the XML file related to the test(s) being run. In VS2010 I had to enable deployment in the .testsettings file (but not add any paths) and then reference the XML file path relative to the TestProject in the DeploymentItem.
Hope this helps.
-- GraehamF"