by Dominic Zukiewicz
10. June 2010 14:11
Overview The XmlSerializer is an excellent utility to turn your classes into XML and vice versa very very easily. So long as you aren't using it on dynamically generated types, but are repeatedly on the same types, then the XML serializer is quite performant. However, as great as the XmlSerializer is, I’ve found it a pain to debug. You have 2 choices: Look through the XML and find the invalid field Step through every property in the debugger for your class and find the property that is failing Problem When your XML document gets to the point of having hundreds of elements, this b...
[More]
by Dominic Zukiewicz
7. June 2010 14:42
The AuthentiX FAQ gives information on how to make AuthentiX the application work with IIS 6 sucessfully, but applying this fix, the site has not worked regardless of the change specified. Since the current version used is out of support, and the client is looking to upgrade to Forms Authentication, I had to make do with the problem. Over the weekend, I had to fix an issue where IIS 6.0, whilst running in IIS 5 Isolation Mode, suddenly (possibly due to a Windows Update) completely crashed IIS, so that it was unusable. IIS 6 kept coming up with the error “The path for the specified directory c...
[More]
by Dominic Zukiewicz
7. June 2010 14:23
One of our clients use a 3rd party authentication tool called AuthentiX, which allows directory level authorisation and the use of multiple data sources to be used for IIS. Although ASP.NET has Forms Authentication, AuthentiX has been in use by the client for over 10 years and so co-existence with ASP was required to allow the retrieval of the username. Its usage is quite simple. If the code is executing on your page, they have been authenticated (or have they?) and given access to it. A code snippet of this COM component looks like this: protected void Page_Load(object sender, Event...
[More]
by Dominic Zukiewicz
12. May 2010 11:09
I was continuing to help migrate some ASP code into .NET. My task this time was to bring the remaining part of the frameset (no, not using Master Pages yet), into .NET. So we have 3 parts: A Frameset page (ASP) Navigation (.NET) Content (.NET) Footer (.NET) But something odd was happening. When the first page request came in, 3 Global_asax.Session_Start events were generated. This caused major problems, as the frames all used the UserId , via the Session. BUT 3 Sessions were being created, and therefore not sharing any new data that went into it. The reason this was happeni...
[More]
by Dominic Zukiewicz
20. April 2010 10:48
Now many people will argue that it is a stupid idea to store clear text credentials in web.config, and in some respects they are right. Obviously the credentials for the website is as clear as day, BUT .config files are not served by ASP.NET, so there are some precautions in place. But if you are writing a test app for the Membership provider and you really can’t be bothered with setting up a SQL Local Data Source and really just want to get your proof of concept out of the way, it really is brilliant. However, although you normally set up Membership once per project, I became a little bit r...
[More]
by Dominic Zukiewicz
24. March 2010 09:29
One problem we have been encountering for nearly a year is a problem which reports ASP.NET errors, but actually does not cause any problems for the user. The error looks like this:
** Events **
---------------
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 3/23/2010 11:44:44 AM
Event time (UTC): 3/23/2010 11:44:44 AM
Event ID: 6be66d016f1e43b48adbd638e202c698 Event sequence: 3548 Event occurrence: 1 Event detail code: 0
Process information:
Process ID: 7872
Process name: aspnet_wp.exe
Account name: WEBSITE\ASPNET
Exception informat...
[More]
by Dominic Zukiewicz
23. March 2010 09:45
I was working on a project in which the traffic had picked up significantly on a database. So in order to allow some of the longer queries to execute, I increased the SqlConnection time by changing the connection string: Connection Timeout=120 Great! We're done - aren't we? Well, no, we aren't. The problem is that although the SqlConnection.ConnectionTimeout has now been changed, the SqlCommand.CommandTimeout does not get affected and remains on the default 30 seconds. You will need to manually copy this value across to the CommandTimeout: SqlConnection conn = new SqlConnection ("M...
[More]
by Dominic Zukiewicz
5. March 2010 16:23
When using Outlook 2010 RC1, I "suddenly" found that when clicking on hyperlinks, I was prompted by the dialog: This operation has been canceled due to restriction in effect on this computer. Please contact your system administrator. Now I have local administrator rights, so I wondered what had happened. Its turns out the culprit was Google Chrome. After recently uninstalling it, I found that had not cleaned my registry properly. The value you are looking for (depending on your SID) is located under: Before: Key: HKEY_USERS\<LONG-SID>-2147\Software\Classes\.html Value:...
[More]
by Dominic Zukiewicz
3. March 2010 12:03
The /admin switch confused me recently, because I thought it was the same features as a normal login. As usual, I was wrong :-) /admin is a reduced set of features that allow you to, in effect, kick people off of the server. Only the full login's (without /admin) have access to features like copy and paste and shared remote drives.
d7d654f1-64b0-4bfb-8f58-e910b46be49c|0|.0
Tags:
by Dominic Zukiewicz
26. February 2010 15:14
I was writing my own custom configuration class to reduce the amount of <appSettings> in my code, but also to make sure the values were type safe. I wrote a simple test application to try this out. 1: class MyConfigurationTestConfiguration : System.Configuration.ConfigurationSection
2: {
3: private static MyConfigurationTestConfiguration settings = ConfigurationManager.GetSection("MyConfigurationSettingsConfiguration") as MyConfigurationTestConfiguration;
4:
5: public static MyConfigurationTestConfigurat...
[More]
by Dominic Zukiewicz
26. February 2010 10:29
Nothing to complex this time, just for reference really. Sometimes you want a simple button to just go back to the previous page. All you need is: <asp:Button runat="server" Text="<%$Resources:MyResources,Back%>" OnClientClick="javascript:history.back(); return false;"/>
The reason I'm using an ASP.NET Button is purely for the Localization functionality, so you can use with with HTML controls as well
by Dominic Zukiewicz
2. February 2010 22:49
When trying to connect to TFS 2008 on VS 2008, I had this error: The path xxx is already mapped in workspace xxx It turns out that when using my VPC, it was cloned incorrectly. Someone else had created a workspace using their credentials, cloned the VPC for my use and then when I logged on using the same account name, I got this error message. The way to allow you to continue is to close VS 2008 and then rename the settings file with a .bak extension located at: C:\Documents And Settings\<current user>\Local Settings\Application Data\Microsoft\Team Foundation\2.0\Cache\VersionControl....
[More]
by Dominic Zukiewicz
2. February 2010 22:29
Recently, I’ve had to interpret some user input and then place this input into an XML file for processing by BizTalk Server 2006. Unfortunately, BizTalk Server 2006 likes you to encode characters using their XML equivalents. Let me explain.. Background This can seem quite easy using the System.Xml.XmlSerializer, with its ability to automatically generate XML and escape invalid characters for us. There are problems though. Here is a template class: public class TestClass { public string Element1 { get; set; } public string Element2 { get; set; } public string Element3 { get;...
[More]
by Dominic Zukiewicz
26. August 2009 09:18
A colleague of mine had some problems after recently upgrading an EPiServer site developed in Visual Studio 2005. The site he was developing was brought up to date by using Visual Studio 2008.
After changing the web project build framework to .NET 3.5, the development machine compiled the site no problem. However the problem was that the STAGE Web.config file had not been updated with some extra entries that the upgrade wizard had put in.
The error he was getting was highlighting the “this PageData data”, saying “Type expected”.
public static class EPiServerExtensions
{
public stat...
[More]
by Dominic Zukiewicz
27. November 2008 12:01
I've found a bug with IE8 Beta 2 (in both IE7 and IE8 browser modes) where list boxes that, although disabled but containing selected items, do not show the selected items. Here is an example of what should be displayed I am selected Not selected I am selecting this as well! Not selected either I am selecting this too! I am selecting this again! For those of you who are not using IE8 Beta 2, here is what it appears like: I am selected Not selected I am selecting this as well! Not selected either I am selecting this too! I am selecting this again! I have logge...
[More]
cc569dcd-b8ca-4ea7-94c7-183bf40cad39|1|5.0
Tags:
Misc
by Dominic Zukiewicz
20. November 2008 09:15
One of IE8's new features is a that when closing a window or tab, it can remember the session ID and therefore maintain the session with a website. This is an advantage if you accidentally close a window or tab, but there is a problem. For example, if you have several logins for a site, each login giving totally separate functionality of the site (e.g customer and administrator), then you may close your browser and login as someone else. What you may find is that when you open a new window, you are already logged in as the other person. Why does this happen? IE8 seems to use the first window...
[More]
67470f55-2ebd-4a30-88bf-d6c77396f50a|1|4.0
Tags:
Misc
by Dominic Zukiewicz
17. November 2008 12:48
The 3 types of connections Silverlight can make are: Connections to web services and WCF services HTTP requests (via HttpWebRequest and WebClient) Raw data transfers When building one of your early applications, you may choose to try out one of these classes to get back a really simple piece of HTML, purely to test the connection. For example: protected void Button_Click(object sender, EventArgs e)
{
WebClient wc = new WebClient("http://www.google.com");
wc.DownloadStringAsyncCompleted += new EventHandler<DownloadStringEventArgs>(wc_DownloadStringComplet...
[More]
16178fd0-c72f-4e47-837c-33d7a15980ff|0|.0
Tags:
by Dominic Zukiewicz
12. November 2008 09:23
I put my VPC's on my external hard disk and run them off there, as the hard drive can run independently of Windows. I've noticed over the past few months, that randomly, my external USB 2.0 hard drive (Freecom 400GB) disconnects for no reason and I get a balloon in the system tray with the title "Delayed Write Problem" , then something to do with G:\$MFT or G:\$Bitmap. Yesterday, I was defragmenting my external hard disk and noticed it kept happening. I turned it off and on again, started defragmenting and the same problem happened. I thought it might be the writing caching, which helps im...
[More]
44e91a6c-fd5b-49e5-9484-4b5141f63b13|0|.0
Tags:
Misc
by Dominic Zukiewicz
9. October 2008 14:35
After various conversations on both internal and external projects, I’ve noticed that some of our web projects were being developed using a Session state called InProc.
InProc means In-Process, so IIS is hosting all of the
Session[“Dom”] = “Idiot!”;
variables. Now, if the web application eats up too much memory, IIS 6 and above can be configured to recycle the Application pool – a contained unit of web sites, in order to free up memory. This is good for IIS but baaaad news for your website, as everything in the Session is lost – that could be shopping basket, current order status, use...
[More]
a4caa8a2-e799-491f-a44a-3796eeeac0c4|0|.0
Tags:
by Dominic Zukiewicz
9. October 2008 10:57
When working on a project recently, the data saved back to the database was huge. We are talking well over 100 properties. After talking to my Java buddy, he said that one way is to create an IsDirty method that returns if the object has changed state. The IsDirty() method is used to query the state of an object - if it has been modified or not. The implementation is up to the developer, but ultimately it's use can save you a trip to the data source. I have split this example into 3 stages: First attempt Refactored Event Handled N.B. This article helps someone in (archaic) .NE...
[More]
b64c2ca6-4858-46ff-8522-36440bf21ed7|0|.0
Tags:
Framework