UPDATE: In trying to replicate this problem one more time to answer your questions I could not! I can only conclude that my initial setup of Mercurial was problematic and/or possibly I was trying to checkin a build that failed compilation before the checkin. Sigh! Thank you so very much for your help. I gave credit for the help on how to do a script. I need to try that for general purposes.
hi all, I hope you can help me :). I am trying to see if Mercurial would be a good DCVS for my project at work, and I'm surely a newbie to many things.
We have a fairly large codebase in C# (Dotnet3.0 not 3.5 , WindowsXP) and it utilizes the GUID feature. I confess to know little about how or why we use the GUID, but I do know that I cannot touch it.
So, when I try hg clone, it fails unless I change the GUID in the cloned directory (ie create new GUID in Visual Studio and then paste that new GUID to replace the old one). To me, this completely defeats the purpose and utility of quick easy clones. It also makes difficult all the many workflows that require multiple clones.
Is there a workaround, or is there something I'm doing wrong? How can I simplify and/or remove this problem?
Would Bazaar make this easier?
Thank you!
You can probably do it in an update hook. I'm no windows scripter, but if you can write a powershell script that calls [system.guid].newguid() and replaces it in that file you can use a hook like:
[hooks]
update=c:\scripts\replace-guid-in-file.PS1 path\to\file\with\guid
Whatever file you're changing these guids in should probably be untracked (put it in your .hgignore) or you're going to end up with a lot of accidental guid changes commited to the repo.
Is this GUID something the editor creates in the project files? In that case, do not check in the project files, or only those that do not contain the GUID.
Related
Having a server that other devs use, I currently log the version of the dll they use. I do that by having the client that use Reflection to retrieve its version:
Assembly.GetEntryAssembly().GetName().Version.ToString();
It's nice, but since it come from dev that uses TFS and do themself the build, I can not see if they have the latest version of the sources. Is there a trick, like a compilation tag, that would easily allow a hash of the generating source code?
Note: I have try to send the MD5 of the dll (using assembly.Location), but it is useless since the hash value changes between 2 compilations (I suppose there is some compilation timestamp inside the generated dll).
This is most collaboraton issue then a coding.
In the moment that you find out that the version is old one.notify them about it.
If the real version is not old one, that means that developers before making buold did not increment the version ID, which is mistake.
In other words, ordanize it among people, and not relly on these kind of tools (if there is any). You trying to create a complicated tool, that will help you avoid mistakes, but humans will find a way to make them again.
So it's better to create solid relation structure among you, imo.
Create a tool on pre build event to hash/last-write-time your code files.
Write the result to a cs file or a embedded resource file.
The result file must exclude in above action.
For prevent skip build (up-to-date) feature not work,Compare the file before write.
And if youre opening the file in IDE will get a prompt `changed from out side' when build.
Seem there is no easy way to do it.
I have inherited an API which doesn't have proper comments, and I am working on changing that.
Anyone know if there is some sort of mechanism to add a default XML comments to all the members of a class or an assembly?
(I remember seeing something like that on a webcast and I think he might have used PowerShell script to achieve that.)
This way I can avoid lots of repetitive steps, and have everything in place to go and start writing just the comments.
Anyone has any better suggestions?
GhostDoc is pretty fantastic for XML documentation, although you'll need to purchase a copy to generate automatic documentation for all classes/members. The free version allows you to right click (or use a hotkey) on class or member and it will generate the documentation.
I've found GhostDoc to be pretty good.
Once you've run it over your code you then simply add details where required.
http://submain.com/products/ghostdoc.aspx
The system for saving/reloading values is convenient but it has one annoying gotcha for a developer: The ID changes on every recompile and thus it's basically useless in development. Are there any easy fixes to this? Google only tells me others have the same annoyance so I doubt there's anything other than doing it myself.
Edit: David Yew is right about the file.
Have you set the version of your exe in the properties of the project? If you set this to something other than 0.0.0.0 I think it will maintain the settings for you.
I'm a beginner so if there is a terminology for what I'm doing I don't know how to search for it. So forgive me if this has been asked before. So here is what I do. Before I make any major code changes, I make a copy of the projects folder and call it "project v6" for example. Then if I really mess things up and cant find a way to undo it, I just go back to the previous folder. This has been working well enough for me but sometimes I forget to do this and have to take 2 steps back. Is there an easier way to do this than the way I am now?
There are many source control tools, which keeps track of all this stuff. Git, subversion, cvs (used wikipedia links, which explains each with more detail. This can be done much more easily once you get used to them.
In both there is commit what you've done to a server (which may be your own machine). But you can store your code somewhere else (so you don't lose everything, in case your hard disk fails or something like that). Google Code is a good example.
Git - harder to use, but very powerful (more used when there are lots of people working on the same project, and even the same file sometimes), much easier to deal with branches and stuff like that (if you don't know what that is, so you probably don't need it yet)
svn (subversion) and cvs - simpler to use, with fewer resources available. Probably enough for your needs
What you're looking for is revision/source control software.
http://en.wikipedia.org/wiki/Revision_control
I absolutely agree you need to start using a source control system. Even if for no other reason than to ingrain good work habits, you will be required at some point to use a source control system.
Having said, if your IDE is Visual Studio (non-express editions) you can use an addins to:
zip the sln for you, such as codeproject - zipstudio
or
keep a "local file history à la Eclipse" visual local history
i am creating my own CMS frame work, because many of the clients i have, the have same requirements, like news module, newsletter module, etc.
now i am doing it fine, the only thing that is bothering me, is if a client wants to move from my server he would ask me to gibe him his files, and of course if i do so the new person who will take it he will see all my code, use it and benefit from i, and this is so bad for me that i spend all this time on creating my system and any one can easily see the code, plus he will see all the logic for my system, and he can easily know how other clients of mine sites are working, and that is a threat to me, finally i am using third party controls that i have paid for their license, and i don't want him to take it on a golden plate.
now what is the best way to solve this ? i thought it is encrypting, but how can i do that and how efficient is it ?
-should i merge all my CS files and Dlls in bin folder to one Dll and encrypt it, and how can i do that ?
i totally appreciate all the help on this matter as it is really crucial for me.
you should read this
Best .NET obfuscation tools/strategy
How effective is obfuscation?
In my experience, this is rarely worth the effort. Lots of companies who provide libraries like this don't bother obfuscating their code (Telerik, etc).
Especially considering what you are writing (CMSes are everywhere), you'd likely see more benefit from your time spent implementing features that put your product/implementation in a competitive advantage and make companies see that the software you are capable of writing has value, rather than the code itself.
In the end, you want to ensure you are a key factor in making software work for a company, not the DLLs you give them.
You'll need to precompile your site and obfuscate dlls.
Visual Studio has something like Dotfuscator Community Edition shipped with it. You could give it a try.
Of course, HTML output, CSS declarations, database structure and stored procedures code cannot be encrypted.
You can however try to compress CSS which will also reduce its readbility by humans.
Check here: The best approach to scramble CSS definitions to a human-unreadable state throughout an ASP.NET application
One other idea would be to use a frame in your HTML and put the most of the site pages inside of it. This way, it will not be visible when doing "View source".
Or just state it clearly that you offer whatever you're doing as a service and do not provide source codes of your work. I somehow doubt salesforce would be willing to give their sources to anyone who asks.