- Create file VersionInfo.cs in solution root folder near .sln file.
- Put version info into the file:
using System.Reflection; [assembly: AssemblyCompany("wonderu.com")] [assembly: AssemblyCopyright("Copyright © wonderu.com 2011")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("3.7.1.2")] [assembly: AssemblyFileVersion("3.7.1.2")]
- Delete corresponding assembly attributes from all AssemblyInfo.cs files
- Link to VersionInfo.cs file in all projects: Project -> Add Existing Item... -> Add as a Link (down arrow near the "Add" button).
Oct 21, 2011
.NET: One version file for all projects in solution
Glean a colleague the method of keeping the version info of all projects in solution:
Oct 20, 2011
SVN: How to commit ("the true way")
Follow the simple rules then you commit to source control (SVN e.g.):
- Before committing the code please update ALL sources. Your code may have references to code in other folders.
- Build whole solution.
- Run unit-tests. You can use the minimal acceptance scenario for these purposes.
- (optional) Run check style utilities such as StyleCop or FxCop.
- (optional) Deploy solution locally and manually check changed cases and related functionality.
- Commit the code with log message:
- Use notation:
- "[+] something has been added (new functions, files etc.)"
- "[*] something has been changed (fix bugs, refactoring etc.)"
- "[-] something has been deleted (delete files, unused classes etc.)"
- Add Jira or other bugtracker issue number to comments. If you use integrated tools e.g. TortoiseSVN+CSharpTest.Net or Visual Studio+TFS you could select the issue number in the client tool.
- Add an additional comments about the changes
- Check how your code builds on the build-server.
- Keep in mind that if your commit is the reason for the project to fail building or otherwise causes a severe bug, you will be taken out of wherever you are (bath, bar, bed whatever) and will be forced into your workplace to fix the problem ASAP ;)
Oct 19, 2011
Free SVN Hosting. Part 2
After 4 years of using hosted SVN I returned to http://assembla.com/ for private projects. It has free plans and very stable!
Oct 17, 2011
Jira: How to add comment from C# code
1. Add reference to web-service http://jiraserver.local/rpc/soap/jirasoapservice-v2?wsdl
2. Execute code:
2. Execute code:
using (var jira = new JiraSoapServiceService()) { var token = jira.login("user", "password"); jira.addComment(token, "Project-2233", new RemoteComment { body = "Comment from C# code" }); }
Oct 14, 2011
SVN: How to get SVN log with C#
using (SvnClient client = new SvnClient())SharpSVN Project: http://sharpsvn.open.collab.net/
{
Collection<SvnLogEventArgs> logItems;
client.GetLog(new Uri("svn://svnserver/mainproject/trunk"), out logItems);
StringBuilder builder = new StringBuilder();
foreach (var item in logItems)
{
builder.AppendFormat("{0}\t{1}\t{2}\t{3}\n",
item.Revision, item.Time, item.Author, item.LogMessage.Replace('\r', ' ').Replace('\n', ' '));
}
File.WriteAllText("log.txt", builder.ToString(),Encoding.UTF8);
}
Subscribe to:
Posts (Atom)