Archive for the ‘.NET’ Category
Posted by jpluimers on 2010/02/12
Google published an interesting graph generated from their internal data based on their indexed web pages.
A quick summary of popular encodings based on the graph:
- Unicode – almost 50% and rapidly rising
- ASCII – 20% and falling
- Western European* – 20% and falling
- Rest – 10% and falling
Conclusion: if you do something with the web, make sure you support Unicode.
When you are using Delphi, and need help with transitioning to Unicode: contact me.
–jeroen
* Western European encodings: Windows-1252, ISO-8859-1 and ISO-8859-15.
Reference: Official Google Blog: Unicode nearing 50% of the web.
Edit: 20100212T1500
Some people mentioned (either in the comments or otherwise) that a some sites pretend they emit Unicode, but in fact they don’t.
This doesn’t relieve you from making sure you support Unicode: Don’t pretend you support Unicode, but do it properly!
Examples of bad support for Unicode are not limited to the visible web, but also applications talking to the web, and to webservices (one of my own experiences is explained in StUF – receiving data from a provider where UTF-8 is in fact ISO-8859: it shows an example where a vendor does Unicode support really wrong).
So: when you support Unicode, support it properly.
–jeroen
Posted in .NET, ASP.NET, C#, Database Development, Delphi, Development, Encoding, Firebird, IIS, InterBase, ISO-8859, ISO8859, Prism, SOAP/WebServices, Software Development, SQL Server, Unicode, UTF-8, UTF8, Visual Studio and tools, Web Development | 7 Comments »
Posted by jpluimers on 2010/01/19
Recently, I had an issue while validating XML with XSD: validation in .NET using the built in classes in the System.XML namespace, and validation in native Windows using the COM objects exposed by MSXML version 6 (which incidentally ships with the .NET 3.0 framework).
Some documents validating OK in .NET did not validate well with MSXML.
I’ll show my findings below, and try to explain the difference I found, together with my conclusions.
The main conclusion is that MSXML version 6 has a bug, but I wonder why I can’t find much more information on it.
Since there is not so much ready to use for validating XML by XSD in .NET and native, I’ll include complete source code of command-line validations applications for both platforms.
.NET source code is in C#.
Native source code is in Delphi.
Read the rest of this entry »
Posted in .NET, C#, C# 2.0, C# 3.0, Delphi, Development, Software Development, Visual Studio and tools, XML, XML/XSD, XSD | 4 Comments »
Posted by jpluimers on 2010/01/12
Finally someone who explains this topic well: CodeProject: Multi-Threading in ASP.NET.
Most of it is based on Web 405 “Building Highly Scalable ASP.NET Web Sites by Exploiting Asynchronous Programming Models” by Jeff Prosise, which should be here on the Microsoft events site (which currently has connection problems) and is referenced here and here.
Recommended reading!
–jeroen
Posted in .NET, ASP.NET, C#, C# 2.0, C# 3.0, C# 4.0, Development, IIS, Software Development, Visual Studio and tools | 2 Comments »
Posted by jpluimers on 2010/01/05
Getting different architectures to talk can be a pain, even when using standards like SOAP.
In this case, the .NET WSDL imports Delphi generated WSDL in a different manner than you’d expect at first sight: when having both an ‘out’ parameter and a function ‘result’, the ‘result’ is not imported well.
But alas: SOAP didn’t accommodate for this situation in the past, and now SOAP now has some additions to solve this.
Bruneau Babet explains this here: [WayBack] SOAP inconsistency? Delphi 2010 (Win32) Server and .NET Client swapping ‘out-parameter’ and ‘result’. – Stack Overflow.
There he explains how to use the parameterOrder attribute, which the Delphi WSDL importer and exporter still do not support.
–jeroen
Posted in .NET, ASP.NET, Conference Topics, Conferences, Delphi, Development, Event, SOAP/WebServices, Software Development | Leave a Comment »
Posted by jpluimers on 2010/01/05
I always forget the pragma syntax, because it differs substantially from the #if syntax, and I hardly use #pragma.
Contrary to #if … #endif, there is no #pragma … #endpragma.
Instead, there is #pragma warning disable ### … #pragma warning restore ###).
Ken Evans wrote a nice blog article about it (a long time ago, but it is still current): Kirk Evans Blog : Suppress warnings in C# 2.0.
And of course: the official docs, which indicate that when you omit the warning list in a #pragma warning restore, then all warnings are restored.
You can get the error numbers from the compiler output window (no, the errors/warnings/hints window does not show the numbers, that would be to obvious).
–jeroen
Posted in .NET, C#, C# 2.0, C# 3.0, C# 4.0, Development | Leave a Comment »
Posted by jpluimers on 2010/01/05
Gerrit Beuze just announced the new beta of ModelMaker Code Explorer 8.
For me, ModelMaker Code Explorer (especially at a price of only EUR 99!) is an indispensable tool for both creating new sources, and maintaining old sources (the refactorings it can do are awesome, but there are many other useful features in it as well).
Over the years, I’ve been using interfaces in Delphi more and more.
Actually, in some of my projects almost all classes implement interfaces.
Therefore, I’m particularly glad with the new feature ‘auto complete style drop down list’ in the ‘Edit Class dialog’ that this beta brings.
More info: ModelMaker Code Explorer 8.02 beta.
Note: if you use Visual Studio, there is a Visual Studio edition of ModelMaker Code Explorer too.
–jeroen
Posted in C# 2.0, C# 3.0, Delphi, Development, Software Development, Visual Studio and tools | Leave a Comment »
Posted by jpluimers on 2009/12/09
Today, I bumped into something utterly strange: requests replayed through Fiddler 2 to a locally running ASP.NET Development Server on Vista using localhost URLs did not give a connection.
I use ASP.NET from both C# and Delphi Prism. Most of my development work is on Windows XP (see notes below) but I test on many platforms.
Moving one of the projects from XP to Vista, and testing with Fiddler, I found that when using Fiddler 2:
This form of URL fails on Vista, but works on XP: http://localhost:49703
This form of URL works both on Vista, and XP: http://127.0.0.1:49703
So on Vista – contrary to XP – localhost requests from Fiddler were in fact being sent to the external network adapter on Vista, and the 127.0.0.1 requests to the internal network adapter.
Since the ASP.NET Development Server is bound only to the internal network adapter, external requests don’t work (boy, I wish they did, it would make some of my debugging so much easier!).
Read the rest of this entry »
Posted in .NET, ASP.NET, C#, Delphi, Development, Fiddler, Keyboards and Keyboard Shortcuts, Prism, Software Development, Web Development | 2 Comments »
Posted by jpluimers on 2009/11/09
This just had this happen on a Windows 2003 server with a client’s client.
Any .asmx page would return a 404 error like this IIS log line shows:
2009-11-06 09:46:05 127.0.0.1 GET /MyVirtualDirectory/MyWebService.asmx – 80 – 127.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.2;+SV1;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729) 404 2 1260
Searching for “iis 404 2 1260 asp.net” found this top from Marc Valk, that solved the issue: ASP.NET v2.0.5727 was prohibited to run.
Which means that none of the ASP.NET bound extensions would work: they all returned 404 errors.
(Note: if you are wondering where your IIS log files are, this post shows you).
–jeroen
Posted in .NET, ASP.NET, Development, IIS, SOAP/WebServices, Software Development, Web Development | Leave a Comment »
Posted by jpluimers on 2009/10/11
Recently, I had to change the “Password Never Expires” flag for some users on Windows systems.
In the past, there used to be a netuser tool available from WindowsITPro where you could use the pwnexp flag to set or clear that flag.
That tool seems to be vanished, so I was searching for alternatives.
Most alternatives I found depend on some kind of scripting, or the use of the WMIC WMI command line interface: that was “out” because this particular setup is running on Windows XP Embedded, which is trimmed down very much.
The only C# example I found was on CodeProject, but it does
- not take into account the existing flags correctly,
- have hard coded literals without any references where they are from,
- use bit flag arithmetic without letting the C# compiler do its magic with enums,
- use a call to the deprecated InvokeGet method,
- use the Invoke(“Put”, … way of calling that so many people use (which actually should have been an – also deprecated – InvokeSet method),
- use COM Interop
Hence the solution below:
C#, with the proper ADS_USER_FLAG_ENUM enum from the MSDN documentation and no COM Interop, it also moves all literals to constants.
Read the rest of this entry »
Posted in .NET, C#, C# 2.0, CommandLine, Development, Software Development, XP-embedded | Leave a Comment »
Posted by jpluimers on 2009/09/29
Nick Hodges just posted he has become the tpfsadmin on sourceforge: the administrative account for the Turbo Power tools and libraries.
It is not an officially sponsored Embarcadero thing, but at best semi official.
However, it is an admirable step into getting the Turbo Power tools and libraries updated in one central place again.
Those tools include OnGuard, Orpheus, SysTools, FlashFiler, B-TreeFiler, Async Professional and many others.
So if you have your own fork of any of the Turbo Power code from sourceforge, then please drop Nick a note.
Many thanks to Nick!
–jeroen
Posted in .NET, Database Development, Delphi, Development, Software Development, Source Code Management, SourceForge, Web Development | 6 Comments »