locked
How to provide a file path to /asmversion option of tlbimp for producing a versioned interop dll? RRS feed

  • Question

  • Hi,

    I am trying to place a dll on post build event using tlbimp.exe and below is the command i am using.

    tlbimp $(IBOUTDIR)\bin\Release\MyAssembly.dll /asmversion:1.0.0.0 /out (IBOUTDIR)\bin\Release\Interop.MyAssemblyLib.dll

    Now in the above command i want to replace the version 1.0.0.0 with a file path from where it will read the version number to provide to the interop dll. I am not sure whether the command can read from a file or not and if it can read from a file, is it restricted to type of file or we can simply have a header file?


    LIFE - “I'm selfish, impatient and a little insecure. I make mistakes, I am out of control and at times hard to handle. But if you can't handle me at my worst, then you sure as hell don't deserve me at my best.”---Marilyn Monroe

    • Moved by Helen Zhao Friday, April 13, 2012 4:52 AM (From:Visual C++ General)
    Tuesday, April 10, 2012 8:38 AM

Answers

  • Hi Pratap, 

    The easier way to do, create a batch file and call batch file on post build

    You can execute batch file by using Call statement, will be something like, 

    call "$(SolutionDir)scripts\tliaction.bat" parameters

    Inside the batch file you can read version number from the file and perform action, this link

    http://stackoverflow.com/questions/298292/reading-a-value-from-a-file-in-a-windows-batch-script

    can help you on this.

    I hope this helps you...


    If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".

    Friday, April 13, 2012 7:02 AM

All replies

  • I am sure you should move to other fourms.

    here we only discuss geenral questions about visual C++.


    Please mark this reply as answer if it helps you! Thanks for your cooperation! Good Luck to you.

    Thursday, April 12, 2012 1:56 AM
  • Thursday, April 12, 2012 9:17 AM
  • Hi Pratap15,

    According to your description and other customer's suggestion, I'd like to move this thread to "Common Language Runtime Forum" for better support.

    Thanks for your understanding.
    Best regards,


    Helen Zhao [MSFT]
    MSDN Community Support | Feedback to us

    Friday, April 13, 2012 4:51 AM
  • I don't think we can do it. 

    According the MSDN library, the asmversion should only be major.minor.build.revision.  

    And why you want to change it like your way?


    Life is not so easy.......

    Friday, April 13, 2012 6:17 AM
  • Hi Pratap, 

    The easier way to do, create a batch file and call batch file on post build

    You can execute batch file by using Call statement, will be something like, 

    call "$(SolutionDir)scripts\tliaction.bat" parameters

    Inside the batch file you can read version number from the file and perform action, this link

    http://stackoverflow.com/questions/298292/reading-a-value-from-a-file-in-a-windows-batch-script

    can help you on this.

    I hope this helps you...


    If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".

    Friday, April 13, 2012 7:02 AM