Tuesday, January 23, 2007

The new Dev & IT Pro days are arriving. More info can be found here.

 

1/23/2007 8:30:55 AM (Romance Standard Time, UTC+01:00)  #     | 
 Monday, January 22, 2007

For the first time, Scott Guthrie will come to Belgium.

Read more and register @ the VISUG website.

.Net | News
1/22/2007 1:29:58 PM (Romance Standard Time, UTC+01:00)  #     | 
 Tuesday, January 16, 2007

I had reinstalled my PC, and I want to add my own code snippets back in VS2005, only they are located on a location that differs from the standard location for code snippets.  So normally you would go to the code snippet manager (Under the tools menu) and you can add your snippets from a different location.

But now the code snippet manager is missing in the tools menu.

You can add the command back by going into Tools/Customize, Click on the Commands Tab, select the Tools Menu, and drag the Code Snippets Manager onto any command bar that you like.

1/16/2007 10:18:47 AM (Romance Standard Time, UTC+01:00)  #     | 
 Tuesday, January 09, 2007

Introduction

The web project model changed in a number of ways between VS 2003 and VS 2005. You just still have two options, namely “In Place Compilation” and “Site Precompilation”.  The first one is the default and standard compilation method.  It’s also the only one, standard provided by the setup project.

In Place Compilation:
ASP.Net 2.0 will compiles each page on first use.  This means that when creating a setup, your .cs/.vb files will also deployed.  However, it’s very easy to use in development stage.

Site Precompilation:
This will precompile your complete site.  To do this you have to use a new utility: ASPNET_COMPLER. 

aspnet_compiler –f –v /whatsnewinaspnet c:\temp\deploy

After the compilation you will also find .compiled files.  These are marker files and should not be deleted.

The last option is, in our opinion, the best. With this option, no .CS files are deployed.

More info can found here:

http://west-wind.com/weblog/posts/2128.aspx
http://www.odetocode.com/Articles/417.aspx

Lucky for us, Microsoft has also seen that sites are deployed in a very different way than “In Place Compilation”.  So they have released a new kind of Web Deployment Project as an add-in. This add-on provides a lot of additional deployment features and capabilities that complement the built-in web project support in the product.

The VS 2005 Web Deployment Project download adds a number of features that integrate nicely inside VS 2005 including:

  1. Control the number of assemblies generated by the pre-compiled web project
  2. Customize the web.config at deployment
  3. Use the full power of MSBuild

You find the installation of the add-on on following location http://msdn.microsoft.com/asp.net/reference/infrastructure/wdp/default.aspx

For a complete walk-through using the VS 2005 Web Deployment Project, I can only recommend the article "VS 2005 Web Deployment Projects" on ScottGu's blog.

1/9/2007 10:09:07 AM (Romance Standard Time, UTC+01:00)  #     | 
 Monday, January 08, 2007
Why do you need them? We could give you a short answer about this. When developing several projects in a company, you want them to have the same look. So, just like me, for every new project you copy files, code, etc from a previous project. The danger is that in the first place you forgot some items and then you have to add them later. This all takes up a lot of work. You could help yourself and your team by creating a project template. When this template is installed you can use it, just like when you start to create a new project with one of the standard templates.
1/8/2007 1:58:44 PM (Romance Standard Time, UTC+01:00)  #     | 
 Friday, January 05, 2007

This means that you can’t post values containing HTML or script tags.  So when you have an ASP.Net page with a textbox on it, and your users enters something like

And then the user press a submit button, they get this error.
More info about this can be found here.

Just change the page-directive on top of your page by adding the tag "validateRequest".  Set this tag to false and your users are able to add HTML tags in your textbox.

1/5/2007 10:21:40 AM (Romance Standard Time, UTC+01:00)  #     | 

I got this error when accessing an ashx file, wich returns some data to me.  After trying to figure out what the problem is, I came to this solution.

It seems that .Net closes connections prior to it being finished.  I think it's a bug in .net which concerns me. 

Find a solution here : http://support.microsoft.com/default.aspx?scid=kb;EN-US;915599

1/5/2007 8:34:32 AM (Romance Standard Time, UTC+01:00)  #     | 
 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)  #     |