Wednesday, January 03, 2007

When you want to build your solution in VS 2005, together with TFS as source control it could that you encountered the following error:

Build FAILED.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(2797,9): error MSB3491: Could not write lines to file "obj\project.vbproj.FileList.txt". Access to the path 'd:\builds\project\obj\project.vbproj.FileList.txt' is denied.

The problem is that this file is checked into source control and they are marked as read-only.  Even by setting the read-only flag to off it doesn’t work, because the next build the flag is switched on again.  As they are intermediate files, generated by the build, these should never been checked in.  So to solve the error above, delete the file from SCC, delete the file from your HD and try again.

1/3/2007 2:47:30 PM (Romance Standard Time, UTC+01:00)  #     | 

As always, you want only a single instance running of your program.  To do this you have to make use of the Mutex object.  By using reflection we get the executing name of our application.  We will use it for checking if there’s already an instance.

The Mutex object can be used for interprocess synchronization.  With this we could check if our application is already running.  With the waitone method we can request the  ownership of our mutext object.  If it return false, then there’s already a process running using this mutex object.

Example code :

using System.Reflection;
using System.Threading;

…..

private static Mutex s_Mutex;

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
s_Mutex = new Mutex(true, Assembly.GetExecutingAssembly().GetName().Name);

if (s_Mutex.WaitOne(0, false))
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
else
MessageBox.Show("Already an instance running", "your application", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}

1/3/2007 9:41:28 AM (Romance Standard Time, UTC+01:00)  #     | 
 Saturday, November 25, 2006

Yesterday we had our .Net 3.0 event with sessions about WPF, WCF and WF.  It was a big success.  The comments we heard afterwards from the attendants were good.

The first session, presented by Gill Cleeren and myself, was a no slide presentation.  It was a try out for us, but what afterwards we heard only positive comments.  Unfortunately we had too little time.

The second session, done by Kurt Claeys, had a very high level.  He did a deep dive into WCF and WF. Just like us, the time was a little too short for Kurt.

You can download here my demos.  The demos of Gill can be downloaded here.

I want to thank all the attendants and if you have any comments or questions about the event or the presentations or the demo’s, you can always leave a comment or send me a message.

Update :

You can find the article about this event also on our corporate blog.
Here are some images:

.Net 3.0 | WCF | WF | WPF
11/25/2006 10:50:25 PM (Romance Standard Time, UTC+01:00)  #     | 
 Friday, November 17, 2006

Jim Erwin found a very special warning from the compiler :

http://geekswithblogs.net/jerwin/archive/2006/11/16/97285.aspx

11/17/2006 12:31:00 PM (Romance Standard Time, UTC+01:00)  #     | 
 Thursday, October 19, 2006

Here at the customer we are encountering a problem when calling our .Net web applications.  Many users are getting a HTTP 400 – Bad Request error (Request Header Too Long). 

After many investigations with other people who do not have this problem when connecting to the web applications, it seems that only users who are belonging to too many groups (>300) get this error.

Here are a few articles on this problem:
http://support.microsoft.com/kb/327825
http://support.microsoft.com/kb/269643/
http://support.microsoft.com/kb/263693/

After checking the workaround proposed in these articles (increasing the MaxTokenSize value to 65535), but it is already done on our workstations!  According these articles, "the token size to 65 KB allows a user to be present in more than 900 groups. Because of the associated SID information, this number may vary”.  In addition, the naming conventions used here for security groups do not help!

If you want to check in which group you belong, you can use following command in a DOS box:

ismember /list

If you want to know, the total groups use this command:

ismember /list|find "User" /c

For myself, at this moment, I belong to 478 groups.

At For the moment, we do not have a solution for this problem.

10/19/2006 4:53:45 PM (Romance Standard Time, UTC+01:00)  #     | 

The Ordina’s N-Technologies team would like to invite you to this event, which will include 2 sessions.  It will be held the 24th of november 2006.

In the first session Gill Cleeren and Sven Cipido will show you more about WPF.  We will show you the capabilities of WPF by showing you many examples. 

In the second session Kurt Claeys will talk about WCF and WF.  He will use a typical developer case to show you how SOA can be implemented in .Net 3.0.

 

For more info or to subscribe for this event, click here.

.Net 3.0 | WCF | WF | WPF
10/19/2006 4:52:40 PM (Romance Standard Time, UTC+01:00)  #     | 

Gill Cleeren, a colleague and friend of me wrote an article about styles and triggers in WPF.

In this article, Gill Cleeren focuses on the aspect of styles and triggers in Windows Presenation Foundation. Styles make it possible to create applications with a uniform look and with a high level of maintainability. Triggers allow WPF styles to change one or more properties in response of a user interaction. In this document, we will use both these technologies to create a richer user experience.

You can find the article here.

WPF
10/19/2006 4:49:19 PM (Romance Standard Time, UTC+01:00)  #     | 
 Monday, August 28, 2006

I had this problem almost a year ago, but finally I've written it down.

The problem I had (and sometimes other developers too) is that I don’t had administrator rights on my local PC.  So I called the people from security about this issue.  They were very helpful for this problem.  Step by step they upgrade my account with more rights and more rights (e.g. rights for the event log, rights for the registry…).  With a few of them I got a step further, but at the end I still haven’t enough rights to install the service.  The last step was to give the full administrator rights on my local PC and it’s just this step that I needed.  As following MSDN article states “Only processes with Administrator privileges are able to op handles to the Service Control Manager that can be used by the CreateService and LockServiceDatabase functions”.

So now we had a problem.  The security people came with two solutions:

  • Every time we need to send the new version to them and they will install it on the server. 
  • We got a second PC with administrator rights, but not connected to the network

Both solutions aren’t that great, but we choose for the second option.  Ones we had the PC, we add our accounts in the administrator group, so we could install the service with our account and we had network connection.

As you can see, in some cases administrator rights as a developer are important on your development machine.

Diederik Krols also blogged about this item, and he has a nice Bart Simpson chalk board about this, which I will include here also and maybe you need to give this picture to security people if you encountered the same problem ;-).

BTW: Dierderik was my scrum master/technical architect there and he helped me a lot with this issue.

8/28/2006 7:02:17 PM (Romance Standard Time, UTC+01:00)  #     | 
 Saturday, August 05, 2006

At my current project we came across the problem that we didn't receive our exception anymore but a TargetInvocationException.  After a little investigation we found where our exception was.  So here's a little explication about it.

When using reflection to create your assemblies, reflection will act like remoting.  So it will invoke your method.  Hereby we have a proxy and the stub.  The moment that in the stub an exception is thrown this exception will be wrapped in a TargetInvocationException.  To see the real exception you can take the innerexception of the exception.

8/5/2006 3:15:30 PM (Romance Standard Time, UTC+01:00)  #     | 
 Thursday, June 08, 2006

Projects in CruiseControl.Net

The CruiseControl.Net tasks are divided in ‘Projects’.  There are several kinds of projects.  This is a possible list of projects on the server :

  • The Continuous Integration Build of an application
  • The Deployment Build of an application
  • Automatic generation of buildscripts for the Visual Studio projects of an application

The technical project leader or the architect/designer could also define specific projects on the server.

 

e.g. only checking FxCop rules, or only run the unit testing,...

 

Projects are defined in the XML way in ccnet.config.  It just a list of projects defined one after the other one.  But keep in mind that those projects could be run parallel (and they will).

 

For each project you have to create a <Project> element with following attributes:

  • Name
  • Work folders
  • Links with source control
  • Running scripts.  These are Nant Targets who can be separated in activities
  • Triggers

The official documentation of the <Project> element can be found here .

 

Continuous Integration Build

It’s a good thing to analyze and describe each project in the first place in a Use Case.

 

After this, you are able to create a sequence diagram :

 

Basic configuration of a Continuous Integration Build project

Here we will describe the first step for our configuration.  It’s very basic.  We just at our project and source control.  We will add other features like tasks, publishers,... later on.

So first create a working directory for your build server.  We propose for this ‘c:\buildserver’.

Secondly we will add the project to the cruise control server.  To do this, open the ccnet.config file in the C:\Program Files\CruiseControl.NET\server directory.

<cruisecontrol>
    <project
        name="ProjectX"
        webURL="http:\\localhost\ccnet"
        workingDirectory="C:\Buildserver">
        <sourcecontrol type="vss" autoGetSource="true" applyLabel="false">
            <executable>C:\Program Files\Microsoft Visual SourceSafe\Common\Vss\template\win32\SS.EXE</executable>
            <project>$/Projects\ProjectX\xxxxx.ProjectX</project>
            <username>VSSUser</username>
            <password>VSSPws</password>
            <ssdir>\\path to VSS DB\SourceDB</ssdir>
            <workingDirectory>Buildserver\ProjectX</workingDirectory>
            <cleanCopy>true</cleanCopy>
        </sourcecontrol>
    </project>
</cruisecontrol>


 

Overview Buildserver chapters on my blog :

Chapter 1 : Introduction
Chapter 2 : CruiseControl.Net
Chapter 3 : Projects
Chapter 4 : Project Structure
Chapter 5 : NAnt and all our buildscripts

6/8/2006 8:07:00 PM (Romance Standard Time, UTC+01:00)  #     |