July 7th, 2009
During the last DevDays (13 – 14 june 2007) in Amsterdam, I particular interested in the new Silverlight sibject. During the keynote Scott Guthrie speaks about the new ‘cool’ Silverlight runtime and development possibilities. He presented a simple ‘Hello World’ demo. A more fancy demo was done by Beau Ambur (Metaliq) to impress with the cool things possible when developing Silverlight applications. I was hooked right away. On the next day I participated in an interview with Scott Guthrie. This interview took more than 1.5 hour and it was hard to end because of the interesting stuff comming up endlessly. This talk inspired me even more to start investigating Silverlight. I have to say that only the 1.1 version of the runtime interests mee. This is because it has a light weight version of the .NET framework included. The whole download for this package is only 4mb…. Quite an achievement when taking into account that the first full .NET framework was about 32mb.
Download the Silverlight runtime and start investigating and development. A single issue I ran into is that I have no space for installing the new Visual Studio Orcas beta 1. So I was looking around I there are any possibilties to start Silverlight development with Visual Studio 2005. I have found a this blog post on this subject. The next thing is to start developing my first Silverlight 1.1 alpha application.
 My main focus will be building more attractive, so called, ‘Business Applications’. These applications usually target on straight data entry with numerous business rules for validation of data. Nice challenge to make this kind of applications attractive. May be my customers are not even interested in an attractive business application……. Hmmm, anyway it is good fun to play with Silverlight 2 and 3!!
Posted in Uncategorized | No Comments »
July 7th, 2009
While working with ASP.NET 2.0 I discovered a problem with uploading of a file and processing the stream serverside. After a while I searched for the same problem. The error is got over and over was: System.ObjectDisposedException: Cannot access a closed file. Off-course other people had the same problem and it seems to be that ASP.NET 2.0 handles uploads differently than ASP.NET 1.1.
The following link explains exactly what causes the problem and how to solve it.
Some extra (little) information can be found on the MSDN site.
Posted in .NET Development, ASP.NET | 3 Comments »
July 7th, 2009
In my former post I recommended to read the forum post following the link beneath it. The solution of the problem is to far reading in the post, I decided to put the solution in this new post and explain a little about it. The link further on is to the MSDN online library about this topic.
<httpRuntime executionTimeout="90"
maxRequestLength="4096"
useFullyQualifiedRedirectUrl="false"
requestLengthDiskThreshold="4096"/>
executionTime: The maximum time the upload can take to execute (easy nah).
maxRequestlength: The maximum length in KiloBytes the request me be. By default this is 4096KB (4mb).
useFullyQuallifiedRedirectUrl: Something about a fully qualified url from client redirects (mostly web browser redirects) . By default this settings is "false".
requestLengthDiskThreshold: This one is a bit more nasty. Microsoft says "The number of bytes that indicate the input-stream buffering threshold". The number may never exceeds the maxRequestLength. If so all the bytes are written to disk. This means more space is allocated then needed. So you have created extra space for unwanted activity on your disk. Someone could upload a nasty piece of software in the extra space allocated. By default the size is 256KB. If all these settings have been configured right, you shouldn’t have any problem uploading files which do not exceed the given boundries.
Find more information on MSDN.
Tags: ASP.NET, disk, execution, file, fully, length, max, problem, qualified, redirect, request, time, treshold, upload, url, use
Posted in .NET Development, ASP.NET | 2 Comments »
July 7th, 2009
I ran into this issue when investigating a question of the client I’am working for right now. The issue came along when we wanted to combine a MCMS (Microsoft Content Management Server) application with a custom piece of software. This custom software should be included in a CMS Template. In CMS a custom channel has to be created and this channel serves as a host for postings based on the CMS template for the custom software…. still with me?
One of the requirements was that the custom software should be accessible only through SSL. So the need of securing one CMS Channel with SSL was born. A short cry for help accross my firm pointed me in the right direction. Steve Gossner (The CMS Guru at the moment). He seems to have created a solution (april 2004). When reviewing the code everything comes clear and makes sense. I already have experience in creating HttpHandlers and -Modules, so I get the concept of this solution. The next challenge is to plumb it all together with CMS on .NET 2.0.
The second part of the solutions is to create a custom channel property. The following link shows an article of Andrew Connell explaining how to create custom properties on CMS channels (section "Limitations of MCMS Custom Properties")
Posted in Uncategorized | No Comments »
July 7th, 2009
I have found a very interesting article that discusses the basic concepts of "multi threading". A very good explanation of how this works. From the basics to the deep internals of how to work with threads. It also mentions the pro’s and con’s of the different threading solutions. Follow the link to read it.
Posted in Uncategorized | No Comments »
July 7th, 2009
When you want to start working with a Team Project, in Team Foundation Server (TFS), you have to connect to the right TFS with the appropriate authorization. When you want to get the latest version from Source Control you cannot do anything. The context menu (right mouse button) shows "No command available". This looks like some thing is wrong with the authorization, but that is not the point. The solution is to open some file from a folder in the grayed out directory tree. You have to select a folder on your local pc to store the file. At this point TFS starts synchronising the folder chosen. Now the connecting has been initialized and all of a sudden the context menu is filled with menu items.
Posted in Uncategorized | No Comments »
July 7th, 2009
Recently I have started to focus on creating. I started with NDoc, my former known tool for creating technical documentation for my class libraries. This tool has not been continued and only supports libraries up to .NET 1.1. So my .NET 2.0 libraries cannot be used in combination with NDoc. After some searching I ended up with the latest tooling from Microsoft, Sandcastle. This tool is in Community Technology Preview version, but functional. Some useful links on Sandcastle: SandCastle Links
After you have downloaded and installed Sandcastle, you can use it by executing it on the command line from windows. But there is help. Some early birds have produced a GUI for Sandcastle. In total I have found two GUI implementations: Sandcastle Help File Builder and Final Builder. Sandcastle Help File Builder: SandCastleCTP
<font face="Arial">Right now I am using the Sandcastle Help File Builder. After installing it, I started creating my configuration. It is like NDoc, so for everyone who is familiar with NDoc it should be easy to use. After having configured my project I executed the creation of the help file. Everything went well except for the fact that it needs HTML Workshop command line compiler, hxcomp. I had to download the right HTML Help wokshop. Finding it was a big deal. I ended up with the following website: HTMLHelp 2.0 This website lists handy items about HTML Help Workshop 2.0, alias MS Help 2.0. The MS Help 2.0 is now encapsulated in the VS2005 SDK
Posted in Uncategorized | No Comments »
July 7th, 2009
This is also an interesting link when starting to integrate Sandcastle into your automatic build or just to absorb knowledge on Sandcastle.
Anders Ljusbergs website
Posted in Uncategorized | No Comments »
July 7th, 2009
A collegue asked me a question which came from his friend. He asked the following question:
I have several pages in which I have to access the following code. I want to avoid to put all this code in every page that exists in my web application.
Private user As User</em>
‘###Loading user parameters (ID, Name, AccessRights,…)
user = Session("user")
If user Is Nothing Then
user = New User
End If
There are several solutions to this issue. I will describe 2 solutions which do the job, this does not mean that there are no other even more efficient solutions possible.
If you need a code example (both C#.NET and VB.NET) for both solutions just send me an email: wouter@goedvriend.com
Solution 1:
- Create a MasterPage with a public property which encapsulates the code to get the User from the Session.
- Add the MasterType directive to each page which needs to access the user property:
< %@ MasterType VirtualPath="~/[YourMasterPage].master" %>
This casts the Page.Master object automatically to the type of your masterpage and this results in the possibility of accessing the public user property.
MSDN link with full explanation.
Solution 2:
- Declare an Interface with a getter property with type User and have your MasterPage implement it.
- Insert the code to get the User from the Session into the getter from the interface declared.
- When calling the Page.Master cast the object to the interface you declared.
- Access the public user property through the casted object.
Conclusion:
Both solutions have the same result. The first is the default asp.net 2.0 solution and is only suitable when puting your general accessable code in your masterpage. Solution 2 gives you some more freedom implementation and decouples your functionality. Other elements in your application are able to implement this interface, so you are never entangled to your masterpage implementation.
Posted in Uncategorized | No Comments »
July 7th, 2009
Always wondering how the internal structure of the Global Assembly Cache (GAC) looks like? Just add a registry sub key "DisableCacheViewer" of type DWORD with value 1 to the path HKEY_LOCAL_MACHINE\software\Microsoft\Fusion.
Read more on this in the MSPress book about CLR via C# Second Edition.
I recommend only to disable the shell extension when you want to take a look to the real structure of the GAC. Re-enable the shell extension if you want to actively use the GAC. The shell extension makes interacting with the GAC a lot easier than doing it yourself.
Posted in Uncategorized | No Comments »