30 Mart 2015 Pazartesi

Build Version Increment - Visual Studio With T4


Visual Studio 2012 için otomatik build versionunu arttırma işlemini uyarlama süreçini resimlerle anlatacağım. 

Uygulamak istediğimiz projemizde ilk olarak AssemblyInfo.cs sınıfı üzerinden AssemblyFileVersion özelliğini kapatmamız gerekiyor. 




Sonrasında projemize "AssemblyFileVersion.tt" ismi ile  Text Template ekliyelim.





AssmblyFileVersion.tt dosyamızın içeriğini aşağıdaki gibi olduralım. Her build işleminde version değerinin revision özelliğini +1 yapmaktadır. (Major.Minor.Build.Revision)




 

<#@ template language="C#" hostSpecific="True"#>
<#@ output extension="cs" #>
<#@ import namespace="System.IO" #>
<#
	int revisionNumber;
	try
	{
		using(var f = File.OpenText(Host.ResolvePath("AssemblyFileVersion.cs")))
		{
			string s = f.ReadLine().Replace("//","");
			revisionNumber = int.Parse(s) + 1; 
		}
	}catch
	{ 	
		revisionNumber = 0; 
	}
#>
//<#=revisionNumber#>
// 
// This code was generated by a tool. Please do not change this document in any of its parts.
// 

using System.Reflection;

[assembly: AssemblyFileVersion("1.0.0.<#= revisionNumber #>")] 




Son adım bir adım kaldı. AssemblyFileVersion.tt dosyasını her build işleminden önce çalıştırmak. Projemizin Property > Builds Events > Pre-build event command line kısmında aşağıdaki kodu eklememiz yeterli.


 

set textTemplatingPath="%CommonProgramFiles(x86)%\Microsoft Shared\TextTemplating\$(VisualStudioVersion)\texttransform.exe"
if %textTemplatingPath%=="\Microsoft Shared\TextTemplating\$(VisualStudioVersion)\texttransform.exe" set textTemplatingPath="%CommonProgramFiles%\Microsoft Shared\TextTemplating\$(VisualStudioVersion)\texttransform.exe"
%textTemplatingPath% "$(ProjectDir)AssemblyFileVersion.tt"


Projemizi derliyelim ve dosya version değerini kontrol edelim. sürekli arttığını göreceksiniz.





Proje örneği : https://drive.google.com/file/d/0ByRFI3ULXVPuZ3NvaXIxMExHT1E/view


100 yorum:

  1. Thanks to this! I don't feel like grabbing a calculator just to see when version 1.0.3394.25054 has been build. I needed a little more control.



    Jane B. of SI Unik

    YanıtlaSil
  2. I do trust all of the concepts you’ve presented on your post. They’re really convincing and will definitely work. Still, the posts are too brief for newbies. May you please extend them a little from subsequent time?Also, I’ve shared your website in my social networks.
    Selenium Training in Chennai

    YanıtlaSil
  3. Download latest android application from Official Apk

    YanıtlaSil

  4. Thanks for sharing this post, it was great reading this article! would like to know more! keep in touch and stay connected
    Lucky Patcher
    whatsapp plus
    Blackmart
    apktroll

    YanıtlaSil
  5. wow great tutorial you have shared keep it up insta download

    YanıtlaSil
  6. very great information you have shared keep it up insta download

    YanıtlaSil
  7. Amazing information provided in the article. Thanks for sharing.
    Download Gbwhatsapp Apk

    YanıtlaSil
  8. I found this informative and interesting blog so i think so its very useful and knowledge able.I would like to thank you for the efforts you have made in writing this article.
    angularjs interview questions and answers

    angularjs Training in bangalore

    angularjs Training in bangalore

    angularjs Training in chennai

    automation anywhere online Training

    YanıtlaSil
  9. Thanks for your informative article, Your post helped me to understand the future and career prospects & Keep on updating your blog with such awesome article.
    Best Devops Training in pune
    Devops interview questions and answers
    Devops interview questions and answers

    YanıtlaSil
  10. Thanks for your informative article, Your post helped me to understand the future and career prospects & Keep on updating your blog with such awesome article.
    angularjs-Training in pune

    angularjs Training in bangalore

    angularjs Training in bangalore

    angularjs Training in btm

    angularjs Training in electronic-city

    angularjs online Training

    YanıtlaSil
  11. Really very nice blog information for this one and more technical skills are improve,i like that kind of post.

    rpa training in chennai |best rpa training in chennai|
    rpa training in bangalore | best rpa training in bangalore

    YanıtlaSil
  12. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.
    Devops Training in Bangalore
    Best Devops Training in pune
    Microsoft azure training in Bangalore
    Power bi training in Chennai

    YanıtlaSil
  13. Movie manager supports all devices, showbox application allows people to download movies, watch movies for free when downloading the app showbox for android at showbxvpn.com website to help people update the fastest movies currently available. now on.

    YanıtlaSil
  14. Experience for yourself the best movies. Watch high quality terrarium tv online. Your terrariumtvultimate provider can see all the things from this app

    YanıtlaSil
  15. Great article, valuable and excellent article, lots of great information, thanks for sharing with peoples.


    ExcelR Data Science Course Bangalore

    YanıtlaSil
  16. Attend The Python training in bangalore From ExcelR. Practical Python training in bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Python training in bangalore.
    python training in bangalore

    YanıtlaSil
  17. It is perfect time to make some plans for the future and it is time to be happy. I’ve read this post and if I could I desire to suggest you few interesting things or tips. Perhaps you could write next articles referring to this article. I want to read more things about it!





    DATA SCIENCE COURSE MALAYSIA

    YanıtlaSil
  18. Nice article, valuable and excellent article, lots of great information, thanks for sharing with peoples click

    YanıtlaSil

  19. wow, great, I was wondering how to cure acne naturally. and found your site by google, learned a lot, now i’m a bit clear. I’ve bookmark your site and also add rss. keep us updated.

    Data Science Course

    YanıtlaSil
  20. your writing is like a breath of fresh air. Thank you for sharing
    I have no words to appreciate you over great articles provided.
    Redeem Google Play Gift Cards

    YanıtlaSil
  21. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.
    digital marketing

    YanıtlaSil
  22. I really like this post it was radiant and organizing post. I must state I acknowledge to scrutinizing How to find bank routing number
    article you're really amazing for sharing this article and keep on extraordinary work.

    YanıtlaSil
  23. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.I know that you explain it very well. And I hope that other readers will also experience how I feel after reading your article
    Data Science Training In Chennai

    Data Science Online Training In Chennai

    Data Science Training In Bangalore

    Data Science Training In Hyderabad

    Data Science Training In Coimbatore

    Data Science Training

    Data Science Online Training

    YanıtlaSil
  24. I read this post two times, I like it so much, please try to keep posting & Let me introduce other material that may be good for our community. data science courses

    YanıtlaSil
  25. Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites!
    sap training in chennai

    sap training in tambaram

    azure training in chennai

    azure training in tambaram

    cyber security course in chennai

    cyber security course in tambaram

    ethical hacking course in chennai

    ethical hacking course in tambaram

    YanıtlaSil
  26. I am looking for and I love to post a comment that "The content of your post is awesome" Great work! data science courses

    YanıtlaSil
  27. I love the design and design of your site.
    Summer is very easy on the eyes, which makes it much more comfortable for me to come here from so many times.
    Have you ever hired a stylist to design your theme? Works extraordinarily!
    ez cd audio converter crack
    microsoft office crack
    little snitch crack
    naturalreader crack

    YanıtlaSil
  28. Very Nice blog keep sharing this post kindly check.I am really amazed with this needful information,Thanks for sharing.


    3dmark professional crack

    YanıtlaSil
  29. There are plenty of options when it comes to digital gift-giving. From food delivery vouchers to subscription boxes, we hope you now have a few ideas you can use to wow your conference attendees and partners at your next virtual event. event management and business invitation examples

    YanıtlaSil
  30. Hi! I would like to write to you! For contact we keep other contacts.
    Is your article about AOL? I need an expert in this field to solve my problem.
    Could! I hope to meet you
    avast internet security crack
    smadav crack
    microsoft office 365 crack
    fxfactory crack
    nitro pro free download with crack

    YanıtlaSil
  31. After looking over a number of the blog posts on your
    the site beutiful post this is good working of site
    iobit-driver booster pro crack
    avg-pc tuneup crack
    easeus data recovery wizard license code

    YanıtlaSil
  32. Your website is really cool and this is a great inspiring article.
    data scientist training in hyderabad

    YanıtlaSil
  33. I am very impressed with your post because this post is very beneficial for me and provide a new knowledge to me
    Native Instruments Reaktor Crack
    Security Monitor Pro Crack
    CoolUtils PDF Combine Crack
    pdfFactory With Serial Key

    YanıtlaSil
  34. Its really solid for you from an overall perspective all window programming foundation. This site is tangling its article are major and vivifying. I appreciated and bookmark this site on my chrome. This is where you can get all break programming in like way present in clear manner.

    https://cracksmad.com/

    YanıtlaSil
  35. Its truly strong for you from a general viewpoint all window programming establishment. This site is tangling its article are major and vivifying. I appreciated and bookmark this site on my chrome. This is the place where you can get all break programming in like manner present in clear way.
    /https://chlicensekey.com

    YanıtlaSil
  36. https://iqbalpc.com/twinmotion-crack/
    https://iqbalpc.com/
    Such an amazing article. This is very knowledgeable and understandable article. Thanks for sharing it with us.

    YanıtlaSil
  37. I am really pleased by your writing skills and the appearance of your blog.
    Is it a sponsored topic or did you personalize it?
    Any method to retain the wonderful level of writing, a great weblog like this nowadays is unusual
    restoro crack
    driver toolkit crack

    YanıtlaSil
  38. we sincerely appreciate the way you blogged. We've added it to our list of bookmarked web pages and will be checking back in the near future. Please also visit my website and tell us what you think.
    Activatedlink
    VMix Crack
    Auslogics Disk Defrag Crack
    Mediamonkey Gold Crack
    Loaris Trojan Remover Crack
    Voicemod Pro Crack

    YanıtlaSil
  39. Looking forward to reading more. Great article post. Fantastic. Thanks so much for the blog. Much obliged. 야한소설

    YanıtlaSil
  40. I want to to thank you for this great read!! I certainly enjoyed every little bit of it. I have you bookmarked to check out new stuff you post… 스포츠마사지

    YanıtlaSil
  41. Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up.
    data scientist training in hyderabad

    YanıtlaSil
  42. I’m excited to discover this page. I need to thank you for one time for this particularly fantastic read!! I definitely really liked every part of it and i also have you saved to fav to look at new information on your site.
    data scientist training in hyderabad

    YanıtlaSil
  43. I am here for the first time. I found this board and I in finding It truly helpful & it helped me out a lot. I hope to present something back and help others such as you helped me.
    ethical hacking training in hyderabad

    YanıtlaSil
  44. Cobra Driver Pack Crack is beautiful software for installing hardware drivers. The software contains the ability to install the missing drivers automatically.Cobra Driver Pack Crack

    YanıtlaSil
  45. An impressive share!
    I have just forwarded this to a colleague who has been conducting a little homework on this.
    And he actually bought me breakfast simply because I discovered it for him... lol.
    So allow me to reword this...
    Thanks for the meal!!
    But yeah, thanks for spending time to talk about this matter here on your internet site.
    mirillis action crack
    movavi video suite crack
    movavi gecata crack
    avs video converter crack

    YanıtlaSil
  46. I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost the past 2 years, but I had no idea of solving some basic issues. I do not know how to Easy to Direct Download All Software But thankfully, I recently visited a website named vstpirate
    PyCharm Crack
    Native Instruments Komplete Crack
    iZotope Nectar Crack

    YanıtlaSil
  47. This is my first time visiting here. I found so much entertaining stuff in your blog, especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the leisure here! Keep up the good work. I have been meaning to write something like this on my website and you have given me an idea.
    data science institutes in hyderabad

    YanıtlaSil
  48. Great job! Your detailed guide on automating version incrementation in Visual Studio using T4 templates is a valuable resource. Your clear code examples make it easy for others to implement this useful feature. Thanks for sharing your expertise!
    Is iim skills fake?

    YanıtlaSil
  49. you highlights how version incrementation helps in bug fixes, feature enhancements, and overall software stability. If you are interested to know more about Data Analytics Courses In Pune,
    click here Data Analytics Courses In Pune

    YanıtlaSil
  50. This step-by-step guide for automating build version increments in Visual Studio 2012 using T4 templates is incredibly helpful. The clarity of instructions and accompanying images make it a valuable resource. Great work!
    Data Analytics Courses In Dubai

    YanıtlaSil
  51. The comprehensive instruction on utilising T4 templates to automate build version increases in Visual Studio 2012 is quite helpful. The resource's value is increased by the detailed instructions and supporting pictures. Exceptional work!
    Data Analytics Courses in Agra

    YanıtlaSil
  52. nice blog
    Data Analytics Courses In Vadodara

    YanıtlaSil
  53. good blog
    Data Analytics Courses In Vadodara

    YanıtlaSil
  54. Thank you for sharing this information. The next time I encounter a blog, I'm hopeful that it will offer a more captivating and intellectually stimulating experience.
    data Analytics courses in leeds

    YanıtlaSil
  55. I want to convey my appreciation for sharing this insightful blog.
    Data Analytics Courses in Leeds

    YanıtlaSil
  56. Bu yorum yazar tarafından silindi.

    YanıtlaSil
  57. Thanks for sharing clear tips and instructions for implementing automatic build version increments in Visual Studio through T4 templates.
    Digital Marketing Courses in Italy

    YanıtlaSil
  58. Fantastic guide on automating build version increment in Visual Studio 2012! Your step-by-step with images is invaluable. Thanks for sharing!"

    Investment Banking Industry

    YanıtlaSil
  59. I have read your Excellent Post. This is a Great Job. I enjoyed reading the post.
    Data analytics framework

    YanıtlaSil
  60. "Appreciate the effort you put into this post! Thanks for sharing!
    Data science course in mumbai.

    YanıtlaSil
  61. This blog explains how to manage version increments for a project in Visual Studio.
    Data science courses in the Netherlands

    YanıtlaSil
  62. "Great tutorial on building version increments in Visual Studio! This is really helpful for developers managing version control and ensuring smooth project progression. Thanks for sharing!"
    Data science Courses in Canada

    YanıtlaSil
  63. This is a really useful guide on automatically incrementing build versions in Visual Studio! It’s something I’ve struggled with in the past, so I appreciate you breaking down the process clearly. I’ll definitely be using these steps in my own projects moving forward. Thanks for the helpful tips!

    Data science courses in Glasgow

    YanıtlaSil
  64. An insightful tutorial on automating build version increments in Visual Studio. Learn more about managing big data with these
    Data science courses in France.

    YanıtlaSil