locked
Conditional Blocks not working on Visual Studio Custom Template RRS feed

  • Question

  • I am trying to make a Custom Visual Studio Template for Windows Phone in Visual Studio 2012.

    I have referred this link : http://www.codeproject.com/Articles/365680/Extending-Visual-Studio-Part-3-Item-Templates   for making conditions based on Tokens.

    But when i add a code like this:

    $if$ ($targetframeworkversion$ >= 3.5)using System.Linq;$endif$

    It is giving me an error "Unexpected character '$' "

    So is there any way to make a custom windows phone templates which can have some conditions?
    Wednesday, March 6, 2013 6:10 AM

Answers

  • Hi Chintan,

    I guess that you see this error in the error list. Yes, it is invalid to use in Visual Studio IDE. However, the cs file is not to be compiled, it  is just a file in template zip.

    You don't mind these error messages. And I have tried the codes you post, it can work well in my template.

    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.

    Thursday, March 7, 2013 3:13 AM

All replies

  • Hi Chintan,

    I guess that you see this error in the error list. Yes, it is invalid to use in Visual Studio IDE. However, the cs file is not to be compiled, it  is just a file in template zip.

    You don't mind these error messages. And I have tried the codes you post, it can work well in my template.

    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.

    Thursday, March 7, 2013 3:13 AM
  • Did you ever resolve this? It is driving me crazy - same problem.

    Bob - www.ContrivedExample.com

    Monday, May 25, 2015 7:17 PM