Why and where is my XmlSerializer failing?

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]

Tags:

.NET 3.5 | Xml

AuthentiX can cause IIS 6 to crash when moving out of Isolation Mode

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]

Tags: , , ,

ASP | ASP.NET | IIS 6.0

Flicks AuthentiX doesn't return a username?

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]

Tags: , , , ,

ASP.NET | ASP | Security

Multiple sessions generated for a single frameset page?

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]

Tags: , , ,

ASP.NET | ASP

Why isn’t web.config working as a credential source for ASP.NET?

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]

Tags: , , , ,

ASP.NET | Security

Health Monitoring reports “Invalid ViewState”

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]

SqlConnection.ConnectionTimeout does not get passed to SqlCommand.CommandTimeout

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]

Tags: , , ,

Data Access | .NET 2.0

Hyperlinks are not working in Microsoft Outlook 2010 Professional

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]

Tags: , , ,

Microsoft Office 2010 | Google Chrome

Local drives and clipboard do not work with Remote Desktop when using /admin

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.

Tags:

TypeInitializationException when using [IntegerValidator] with a [ConfigurationProperty]

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]

Tags: , ,

C#

Making a simple Back button using JavaScript in ASP.NET

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

Tags: ,

ASP.NET | JavaScript

Sharing Virtual Machines with TFS Workspaces

by brad 4. February 2010 09:22
We tend to use a virtual machine per external client so that we can keep things nicely separated. We can then easily add people to a project by giving them a copy of the virtual hard disk and they can be up and running in minutes (once they’ve renamed the guest machine name to avoid IP conflicts!) That worked fine until we started using TFS, where it would moan that the workspace doesn’t exist because its now a different user accessing TFS. After some digging i found the answer was to edit the following file: C:\Documents and Settings\[USER NAME]\Local Settings\Application Data\M... [More]

Tags:

Team Foundation Server

“The path xxx is already mapped in workspace xxx” when connecting to Team Foundation Server 2008

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]

Tags:

Team Foundation Server | Visual Studio IDE (2005/2008)

How to use a CDATA section with an XmlSerializer

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]

Tags:

Xml | .Net Framework

Customising TFS Work Item ‘Assigned To’ Column

by brad 26. January 2010 14:41
We’ve recently been looking at importing Microsoft Project tasks into TFS so that the developers can see their tasks inside visual studio. However the first snag was that TFS work items aren’t able to support more than one resource being assigned to them, a problem when your Project Manager has allocated more than one developer to do the same thing! Also some of the tasks in the project plan are assigned to the client, E.g. ‘Sign Off Wireframes’ and by default TFS will only allow you to assign work items to valid users than exist in your companies Active Directory. I got round the multiple r... [More]

Tags:

Team Foundation Server

FindControl() recursively using an Extension Method

by brad 26. January 2010 11:15
FindControl() is great if you’re looking for a control one level down, but if you’re making a dynamic control with n levels of child controls it can become a pain… Extension Methods to the rescue! Not only does it find the control your looking for at any level in the page, it also used generics to return the control without needing to cast it. /// <summary>/// Finds the control (Recursively) with an ID matching that given, of the Type requested. /// No need to cast either!/// </summary>/// <typeparam name="T">The type of control to return</typeparam>///... [More]

Tags:

ASP.NET | .NET 3.5 | C#

Dependency Injection and Inversion of Control with ASP.NET MVC

by matt 27. November 2009 17:24
I’ve been looking in to MVC a fair bit recently (more specifically Microsoft’s implementation) and came across this article about Dependency Injection by Mike Brind.  Well worth a read as it explains the concept very well if you’re not familiar with it.

Tags:

ASP.NET | .Net Framework

EPiServer: Adding an XForm to a Page

by matt 20. November 2009 10:08
I wanted to have a little play with XForms last night and have to say I was a little surprised.  Not necessarily with the complexity of displaying a form on a page, but with the lack of documentation about how to do it.  Now that I've figure out a method of displaying an XForm, I though I would share it in the home the less people suffer the problem in the future. First off, EPiServer has a page about developing with XForms which is worth a read, but it is by no means an exhaustive list of how to actually use an XForm. To get a form on your page, do the following (well, this is what I did an... [More]

Tags:

EPiServer

EPiServer: Generated Language XML Files

by matt 24. September 2009 09:32
I’m working on a new project at the moment and am aware that we’re probably going to have a fair few translations to do.  Our general approach at Interakting with regards to labels (i.e. static bits of text that are not content managed) is as follows: Create an Excel spreadsheet once we know what all of the labels in our final site are going to be with a tab for each control and page type.  This is a manual process carried out by some poor person reading the XML files in the project. Supply that spreadsheet to the customer/translation agency.  The afore mentioned ‘poor perso... [More]

Tags:

EPiServer

Extension methods not working after upgrading VS 2005 Web Project to VS 2008

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]

Tags:

Visual Studio IDE (2005/2008) | EPiServer

Powered by BlogEngine.NET 1.5.0.7
Theme by Interakting

Interakting

A full service digital agency offering online strategy, design and usability, systems integration and online marketing services that deliver real business benefits and ensure your online objectives are met.

Calendar

<<  January 2012  >>
MoTuWeThFrSaSu
2627282930311
2345678
9101112131415
16171819202122
23242526272829
303112345

View posts in large calendar