locked
Visual studio template folder RRS feed

  • Question

  • Hey,

    I'm working on a visual studio template for c++ and in the vstemplate-file is used for a file TargetFileName="\MyProject\MyAppName\$safeprojectname$.h" to specify that there should be folders created.

    But when I create a new project through my template I get the followin error: 'A target file name within the VSTemplate file is invalid, it contains a fully qualified path'.

    I checked the msdn-website and there it is written, that this should work: '<ProjectItem TargetFileName="\Folder\item.cs">item.cs</ProjectItem>'.

    So could you tell me what problem could cause this error?

    Thanks in advance!

    Tuesday, December 4, 2012 10:56 AM

Answers

  • Hi,

    Yes, I can produce this issue in my computer.

    The error show it contains a fully qualified path. We can change it like:

          <Folder Name="MyProject">
            <Folder Name="MyAppName">
              <ProjectItem ReplaceParameters="true" TargetFileName="$safeprojectname$.h">abc.h</ProjectItem>
            </Folder>
          </Folder>   
    Best regards,

    Ego [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 nubera Wednesday, December 5, 2012 3:44 PM
    Wednesday, December 5, 2012 7:16 AM

All replies

  • I think the problem is because I work with C++. Is there a possible way to build visual studio templates for c++, where I can change the folder structure of the template?
    Tuesday, December 4, 2012 3:42 PM
  • Hi,

    Yes, I can produce this issue in my computer.

    The error show it contains a fully qualified path. We can change it like:

          <Folder Name="MyProject">
            <Folder Name="MyAppName">
              <ProjectItem ReplaceParameters="true" TargetFileName="$safeprojectname$.h">abc.h</ProjectItem>
            </Folder>
          </Folder>   
    Best regards,

    Ego [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 nubera Wednesday, December 5, 2012 3:44 PM
    Wednesday, December 5, 2012 7:16 AM