locked
DeploymentItem attribute relative path not working RRS feed

  • Question

  • Hi,

    I am trying to use deploymentItem attribute to deploy files from current solution and it works fine, however I also want to deploy files from a different solution which is two folders above the current solution folder, and it is not going to the correct path when using Mstest. It is going two folder up from where the Mstest.exe is present under program files. How do I make it point to correct folder? Is there a way I can use variables in deploymentItem attribute so that I can get the complete physical path through code and then try to deploy it?

    Thanks,

    DPatsy

    Friday, May 17, 2013 6:25 PM

Answers

  • Hello,

    Thank you for your post.

    Just to make the issue clearly,

    1. What type of VS do your use?
    2. Are you working with unit test project?
    3. If you run test from VS IDE, will you see the same issue?
    4. After you run test using MSTest, will you get any errors? If yes, please provide us detailed error message.

    from a different solution which is two folders above the current solution folder

    I am not very sure about your scenario. Do you mean the deployed file is in another project directory?

    As my experience, if you want to deploy a file which is in the folder of the project in VS2012, you need to specify the entire path of the file in DeploymentItem attribute.

    I don't know why you put the deployed file out of the project. Generally we move the item into your build output directory as part of the build process to avoid dependency on your project structure.

    If this is not your scenario, can you provide us a simple example so that we can repro this issue?

    Please attach your Visual Studio solution, you can upload it to the sky driver, and then share the download link in your post. Thanks for your understanding.

    In addition, I don't see some samples which use variables in DeploymentItem attribute programmatically. Based on this link, it seems that we can't do that:

    http://stackoverflow.com/questions/2133879/c-sharp-using-static-variable-as-parameter-to-deploymentitem

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Amanda Zhu Thursday, May 23, 2013 9:20 AM
    Monday, May 20, 2013 7:14 AM

All replies

  • Hello,

    Thank you for your post.

    Just to make the issue clearly,

    1. What type of VS do your use?
    2. Are you working with unit test project?
    3. If you run test from VS IDE, will you see the same issue?
    4. After you run test using MSTest, will you get any errors? If yes, please provide us detailed error message.

    from a different solution which is two folders above the current solution folder

    I am not very sure about your scenario. Do you mean the deployed file is in another project directory?

    As my experience, if you want to deploy a file which is in the folder of the project in VS2012, you need to specify the entire path of the file in DeploymentItem attribute.

    I don't know why you put the deployed file out of the project. Generally we move the item into your build output directory as part of the build process to avoid dependency on your project structure.

    If this is not your scenario, can you provide us a simple example so that we can repro this issue?

    Please attach your Visual Studio solution, you can upload it to the sky driver, and then share the download link in your post. Thanks for your understanding.

    In addition, I don't see some samples which use variables in DeploymentItem attribute programmatically. Based on this link, it seems that we can't do that:

    http://stackoverflow.com/questions/2133879/c-sharp-using-static-variable-as-parameter-to-deploymentitem

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Amanda Zhu Thursday, May 23, 2013 9:20 AM
    Monday, May 20, 2013 7:14 AM
  • Hello,

    Since we haven't heard from you for some time, I temporarily close this case. I mark useful reply as answer. If you have any concerns, please feel free to unmark it to reopen it or submit a new question.

    Thanks for your understanding.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, May 23, 2013 9:20 AM