Friday, October 11, 2013

Working with Profile in web applications

The last time I worked with Profiles was back on the days we were creating web sites. Recently I had to add support for profiles in an old school web application. I tried to remember what I was doing back in the days, and I finally figured out that the code generation feature of Profile does not work in web application (only web sites). This means that you have to manually to the casting from
HttpContext.Current.Profile.GetPropertyValue and even worse you have to call a SetPropertyValue method to set the Profile property which is really ugly! The good news is that you can still use the inherits property of the Profile configuration and set your own class, instead of specifying the properties inside the web.config.

Monday, October 7, 2013

Atheros L1 Gigabit Ethernet on windows 8 disconnects

I have a P5KC Asus motherboard which comes with a Gigabit adapter onboard. The problem is that Asus has stopped support of the MoBo since Vista and my machine is perfectly fit to run win 8 (actually I just got 8.1 and I remembered to do this post). Windows 8 detects vendor id 1969 and device id 1048 as Atheros L1 Gigabit Ethernet 10/100/1000Base-T Controller, but I had the problem of the network being disconnected after a few file transfers or video streams.

Tackling the PathTooLongException

I received a System.IO.PathTooLongException the other day while deleting some files using System.IO.File.Delete. It seems that .net cannot handle long file names and I had to revert to plain old win32 api to do the job using the following declaration:

I have also spotted Delimon.Win32.I​O Library (V4.0) which I would have used if it was available as a Nuget package. This lib provides a lot of System.IO classes using the win32 api instead, handy if you are dealing with long filenames.

Friday, October 4, 2013

DataServiceClientException request entity is too large

I had an issue with some wcf DataServices that I had deployed some time ago. The problem was that the occurring on the client when the SaveChanges method was called when an entity was too big (larger than 48k). I had all the maxReceivedMessageSize in place and the problem was occurring only in the https binding (needed to exchange certificates with the client).