Skip to main content

Posts

Showing posts from 2009

TFS Build and password protected strong name keys

A problem that I and many others have had occurs whe you use TFS Build to build projects that are signed with a password protected strong name key. When the project is built the first time in Visual Studio a dialog pops up prompting for the password. In an automated build process this dialog cannot be displayed, which results in the following error:

C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1805,7): error MSB4018: The "ResolveKeySource" task failed unexpectedly. System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application. at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at System.Windows.Forms.Form.ShowDialog() at Microsoft.Build.Tasks.ResolveKeySource.ResolveAssemblyKey() at Microsoft.Build.Tasks.ResolveKeySource.Execute() at Micros…

MCTS: Visual Studio 2005 Team Foundation Server

I am proud to announce that I have made the cerification MCTS: Visual Studio 2005 Team Foundation Server. This turned out to be a fairly smooth process since the certification only consists of one exam. This certification is a must have if you are working with installation and configuration of Team Foundation Server.

It is kind of puzzling that there is no upgrade of the exam 70-510 for TFS 2008. Sure there are not any ground breaking changes since TFS 2005, but it still has been three years.

Certifications sure are fun, I wonder what is next?

Scott Guthrie in Stockholm

Today Scott Guthrie visited Stockholm and Chinateatern to talk about the news in Visual Studio 2010, ASP.NET 4, ASP.NET MVC 2 och Silverlight 4. I could sum this up with just one word: awesome!

As usual I get incredibly excited to get my hands on all of these new cool stuff and I am really longing for the release of  Visual Studio 2010 . Until further notice I have to settle with playing around with the beta 2 at home. I am not going to go through all of the news in the products, because it is available in so many other places, such as  Scott Guthrie's blog. He has among other things written a series of posts where he deals with the news in  Visual Studio 2010 .

Much of what was shown today I have already seen or read about on various blogs, but one thing that I completely missed is the IIS SEO Toolkit. It is simply a tool that is installed as an addition to IIS 7 and analyzes the search engine friendliness of any public web site at any time. Scott has done an absolutely brilliant …

Lost camera icon in iPhone

Me and my co-workers recently ran into an issue with our iPhones. All of a sudden the camera icon dissappeared and it required a hard reset to get it back. At least that is what we thought. When i set up my Exchange account in the iPhone, the camera icon dissappeared again. It turned out to be our Exchange server that caused this behaviour.

A couple of weeks ago we upgraded our Exchange environment to Exchange 2007. In Exchange ActiveSync it is possible to set policys for the connecting devices. One of the policies allows the use of the camera and this is disabled in the default policy.

Team Foundation Server Power Tools

Since I moved to Stockholm and caused our development team to be divided into two offices the need for a good team platform has increased. Team Foundation Server does the job perfectly, but the fact that I have not found TFS Power Tools until now is stunning, because it is exactly what I have been looking for.

TFS Power Tools contains among other things increased possibilities for team member communication through Windows Live Messenger integration in Visual Studio. On top of that there are a large amount of useful tools that makes everyday life a little bit easier. The following features are installed with the installation package tfpt.msi:
Command line tool (TFPT.EXE)Team Explorer IDE menu additionsBuild Notification toolTFS Best Practices AnalyzerProcess Template EditorWork Item TemplatesCustom check-in policiesTFS Server ManagerTFS Users toolAlert EditorTFS Power Shell ExtensionsTFS Windows Shell ExtensionsTeam Members Tool

Active Directory Topology Diagrammer

I sometimes get very positively surprised by Microsoft. In the work of cleaning and structuring an Active Directory environment we wanted to produce a graphical overview of our current forest. It did not take long before I found Active Directory Topology Diagrammer, which is an absolute perfect tool for this purpose. And it is free!

Active Directory Topology Diagrammer gets the entire AD structure according to the parameters you supply and draws the structure in a Visio document. It does however require Visio 2003 or later installed to be able to do this export.

Experiences with TFS Destroy

During the last weeks we have been working on cleaning the TFS Version Control from old files. We encountered some unexpected problems, most of which was caused by the fact that the hard drive that holds the database only is 70 GB. The size of the database was around 30 GB and the files to be destroyed were around 15 GB. What we found was that destroying large amounts a data also requires large amount of disk space.

The destroy-command marks the files to be destroyed and a scheduled job is run each night to perform the actual destroy. This job can also be invoked manually from SQL Management Studio.

When the TfsVersionControl Administration Job is run the transaction log is filled with up to 2.5 times the size on the data that should be destroyed. That means that before the transaction is committed the size of the log in our case was around 40 GB. This meant that before the transaction could be committed we ran out of disk space and the job was cancelled.

With some modifications on my…

Destroy old data in TFS

Team Foundation Server only performs soft deletes and the files are very easy to recover just by performing an undelete. After a while the deleted files may use a lot of unneccesary space. From TFS 2008 it is possible to erase the data from the database. On option would be to use tf.exe and the destroy command. That however will be pretty tedious when there is more than one file that should be destroyed. I have created a small application to help with this task.

The TFS communication is handled in a separate class which i very simple without any error handling.

using System; using System.Net; using System.Windows.Forms; using Microsoft.TeamFoundation.Client; using Microsoft.TeamFoundation.VersionControl.Client; using Microsoft.TeamFoundation.VersionControl.Common; namespace TFSCleanupTool { internal class TFS { private string ServerName = null; private VersionControlServer VersionControl = null; internal TFS(string servername) { Ser…

Shuffle part of a List

The amazing game the Cornball is about to be ported to C#.NET. A project which is a lot easier than expected. The number of hours I put down so far is barely hitting two digits and still I have reached a playable alpha version. The source will be published in parts or in its entirety when I am finished, but until then there is one small problem I would like to show that required some extra thought.

The class structure consists of Card and Deck, which inherits List<Card>. Deck has a Shuffle method which utilizes the Fisher-Yates algorithm.

public void Shuffle() { Random random = new Random(); for(int i = Count - 1; i >= 0; i--) { Swap(random.Next(i), i); } } internal void Swap(int fromIndex, int toIndex) { Card temp = this[fromIndex]; this[fromIndex] = this[toIndex]; this[toIndex] = temp; }
In the middle of the game, only a part of the game should be re-shuffled, which renders this method useless. Long story short, I came up with the followi…

SNMP in C#.NET

One of our applications is going to send network status messages using SNMP. This is nothing we have done before and seems like a fairly extensive project. That is why I was very happy to find #SNMP Library on CodePlex. Thank you Microsoft for this magnificent open source community, and of course a big thank you to all the contributors! I have not contributed to anything yet, but I feel a sudden urge to do so.

Now there are only some specifications and a little development before we can name ourselves SNMP experts. I will post some code as soon as I have something to show. Until then all I can do is to recommend the samples included in #SNMP.

Nostalgia in Win32 API

I started my programming career by modifying a guestbook written i Perl for one of my first web sites. When I took the step into the Windows platform the natural choice was the Win32 API and C. In my early teens I managed to create a couple of really interesting applications. When Google recently found a web site from 1999 for one of these applications I had to take a trip down the memory lane.

I have now found two amazing application, written by me in my teens, which even seem to work pretty good on todays operating systems, including a 64-bit Windows 7. The applications are developed and tested for Windows 95/98 so there are no guarantee for the function on other platforms. What I can guarantee is that the applications are 100% free from any malware or other bad stuff.

Text is a revolutionary text editor focused on fancy word proceccing functions instead of unnecessary eye candy.
The Cornball is a solitaire game where the goal is to put the cards in order from 2 to King.

Enjoy!

Elevated Privileges Application Launcher

At a number of times we have had requests to be able to run applications as a normal user even though the application is designed to run as an administrator. This could be handled manually by setting the privileges on each computer for certain paths and registry keys and any other resources the application requires. This easily gets out of hand and there is a much better solution, spelled EPAL.

Sure, it requires some configuration and tweaking, but when set up it works like a charm and is a great tool to compensate for poorly written Windows applications requiring administrative privileges.

GETDATE() and DST in SQL Server Compact

We have had issues when synchronizing date and time in some handheld Windows CE devices. Time always seem to get an hour wrong and we have already confirmed that it has to do with Daylight Savings Time. But we have not figured out what and why until just recently.

In some cases we have used the SQL method GETDATE(), in other cases DateTime.Now(). The case where the latter is used there are never any issues, but with GETDATE() we get the one hour difference most of the time. This is simply caused by the settings and configuration in the handheld device and SQL Server Compact.

A proper solution would be always to use UTC-date in the application and the database to get rid of such problems. But since that would be a major change we decided to just go with using DateTime.Now() instead of GETDATE().

Problems and solutions

This week has been lined with clumsiness, weird problems and some pride. The latter because I actually managed to conquer the problems.

The clumsiness was just me managing to shut myself out from my computer. All accounts except the domain accounts were disabled, the domain cache was disabled and network settings not allowing contact with the domain. That is not a good combination. Thanks to Offline NT Password & Registry Editor I got in again just fine. The reason this all happened was mainly a security aspect, but combined with the poor network settings it turned out to be way too secure.

The weird problems had to with our Windows CE application. As usual the information supplied from the users is very limited, like "it doesn't work". But when I finally got my hands on the log files I got even more confused. Weird problems in the shape of SqlCeExceptions, no GPRS connection, sudden torn-offs... It turned out to be a memory card that was loose. The database is store…

TEC Europe 2009

TEC Europe is over and I am at the Hilton Berlin waiting to go home. The overall impression of the conference is really good, although I as a developer indeed was a minority.

I have only visited the Active Directory-related sessions and I have definately gotten some clarification in some areas. For example I can mention that I feel somewhat stupid that our AD-classes are still based on System.DirectoryServices, instead of System.DirectoryServices.Protocols. The former is based on LDAP via ADSI, while the latter is a wrapper to wldap32.dll.

For more information about the lectures, and what they are talking about, check out www.tec2009.com.