are my local.testsettings properly loaded ?

Answered are my local.testsettings properly loaded ?

  • 26. dubna 2012 14:02
     
     

    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

Všechny reakce

  • 27. dubna 2012 4:14
     
     Odpovědět

    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.

  • 27. dubna 2012 4:26
    Moderátor
     
     Odpovědět Obsahuje kód

    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