locked
are my local.testsettings properly loaded ? RRS feed

  • Question

  • Hallo,

    I added a file in the Deplyment section of the local.testsettings but it does not get copied to the deployment folder. I would like to access this local.testsettings programmatically during the testing in order to check if they are properly loaded and if the paths are the correct ones. Is it possible to do that ?

    Thanks

    Thursday, April 26, 2012 2:02 PM

Answers

  • Hi,

    Have you set the 'Copy to Output Directory' property of the file to be deployed to 'Copy always'?

    Right Click the file -> properties -> Copy to Output Directory -> change its value to 'Copy always'.

    -Tejas.

    • Marked as answer by Tony xiao Friday, May 4, 2012 3:21 AM
    Friday, April 27, 2012 4:14 AM
  • Hi Davikokar,

    For deployment you could use deployitem attribute on top of test method, please refer to the following link from MSDN which is about this attribute detailed information:

    Also consider into you want checking the deployment node in local.testsettings file, I don't think it's a good idea. After you add a file through deployment section the VS would add following node into Local.testsettings, there isn't any node about deployment directory:

      <Deployment>
        <DeploymentItem filename="New Text Document.txt" />
      </Deployment>



    Tony Xiao [MSFT]
    MSDN Community Support | Feedback to us

    • Edited by Tony xiao Friday, April 27, 2012 4:26 AM
    • Marked as answer by Tony xiao Friday, May 4, 2012 3:21 AM
    Friday, April 27, 2012 4:26 AM

All replies

  • Hi,

    Have you set the 'Copy to Output Directory' property of the file to be deployed to 'Copy always'?

    Right Click the file -> properties -> Copy to Output Directory -> change its value to 'Copy always'.

    -Tejas.

    • Marked as answer by Tony xiao Friday, May 4, 2012 3:21 AM
    Friday, April 27, 2012 4:14 AM
  • Hi Davikokar,

    For deployment you could use deployitem attribute on top of test method, please refer to the following link from MSDN which is about this attribute detailed information:

    Also consider into you want checking the deployment node in local.testsettings file, I don't think it's a good idea. After you add a file through deployment section the VS would add following node into Local.testsettings, there isn't any node about deployment directory:

      <Deployment>
        <DeploymentItem filename="New Text Document.txt" />
      </Deployment>



    Tony Xiao [MSFT]
    MSDN Community Support | Feedback to us

    • Edited by Tony xiao Friday, April 27, 2012 4:26 AM
    • Marked as answer by Tony xiao Friday, May 4, 2012 3:21 AM
    Friday, April 27, 2012 4:26 AM