CodeSmith Community
Your Code. Your Way. Faster!

how to protect the .csproj file to be overwritten

Latest post 12-01-2006 12:22 AM by madpeter. 4 replies.
  • 11-30-2006 1:17 PM

    • ppcuban
    • Top 500 Contributor
    • Joined on 11-17-2006
    • Posts 16
    • Points 470

    how to protect the .csproj file to be overwritten

    Hello. I am losing all the changes in my csproj everytime i genrated my code with the codesmith. Is there a way around to solve this? Should i modify the template that creates the project files for the solution. I gues also the solution will get overwritten in time. I am loosing all the references to other dll, etc.

    Please, help needed

    Jose

    • Post Points: 35
  • 11-30-2006 3:09 PM In reply to

    • swin
    • Top 10 Contributor
    • Joined on 06-14-2006
    • London, UK
    • Posts 925
    • Points 34,785

    Re: how to protect the .csproj file to be overwritten

    I don't think you can "protect" your project file - it get rewritten each time a gen is done. 

    You either have to add the references to your templates (and remember to do it each time you upgrade the templates) or have another project in your app which isn't auto generated so you can control what references you have (including the NetTiers generated ones).  At the moment I do the later.

    HTH

    swin 

    ------------------------------------------------- Member of the .NetTiers team -------------------------------------------------
    • Post Points: 35
  • 11-30-2006 4:01 PM In reply to

    • ppcuban
    • Top 500 Contributor
    • Joined on 11-17-2006
    • Posts 16
    • Points 470

    Re: how to protect the .csproj file to be overwritten

    Thank for the info.

    How do you handle team development with visual source safe.  I have to check out the entire project and all .cs files to regenerate.  Is there a best practices for this kind of stuff?

     

    • Post Points: 35
  • 11-30-2006 4:45 PM In reply to

    • swin
    • Top 10 Contributor
    • Joined on 06-14-2006
    • London, UK
    • Posts 925
    • Points 34,785

    Re: how to protect the .csproj file to be overwritten

    vss is a pain!

    One person (me) does the gens.  I use the VSS gui to check in stuff, keeping the generated stuff always checked out.  When any new files are added I go through by hand and make sure they are checked in so others can work on them.  No one should work on the generated stuff so thats why I keep it checked out.

    Its not great, but it works.  

    When I first started using NetTiers I asked the same question and Robert H (I think) said "don't walk, run away from VSS".  Unfortunately he was right,  but like many shops we don't really have any choice at the moment.  Hopefully in the new year we will be moving to something better.

    HTH

    swin 

     

    ------------------------------------------------- Member of the .NetTiers team -------------------------------------------------
    • Post Points: 35
  • 12-01-2006 12:22 AM In reply to

    • madpeter
    • Top 150 Contributor
    • Joined on 03-10-2004
    • Posts 35
    • Points 815

    Re: how to protect the .csproj file to be overwritten

    For me it is also a painful experience to work with Source Safe in a multi developer environment. I work with a team of 5 developers using NetTiers generated code, we have come up with a process using MSBuild that goes something like ....

    • Check out from VSS into a temp directory all files,
    • Generate into that directory,
    • Use an XML tool found on gotdotnet - Microsoft XML Diff and XML Patch (http://www.gotdotnet.com/team/xmltools/) to make a comparison and then a patch of the origional csproj file with the new csproj file so that the information for Source Safe and References to other projects are maintained. If we have deleted some files ( removed database tables) then we have to manually remove them from the projects. (this is a rare case) .
    • Check in generated files from the tempory directory
    • Manually make a get latest from our solution.

    This works somethimes without problems , other times though we get messages from Source Safe saying that our bindings are corrupted and we need to make an analysis of VSS. After doing this there seems to be no problem and we can work again as normal. All in all VSS is a frustrating experience for us, but we are also tied to using VSS at the moment. In our case we try not to regenerate too many times a day, best is if we start this process before lunch or at the end of the day as another condition is that all the files have to be checked in for our process to work.

    Filed under:
    • Post Points: 5
Page 1 of 1 (5 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems