The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

Archive for the ‘.NET 4.0’ Category

.NET/C#/WinForms: small code snippet to enable Ctrl-A for select all in a single/multi-line TextBox

Posted by jpluimers on 2012/12/04

WinForms does not automatically enable Ctrl-A as “Select All” action.

The below code snippet works when you bind it to the KeyDown event of a TextBox (actually the event is on Control).

The e.SuppressKeyPress = true suppresses the bell sound in a multiline TextBox, as e.Handled = true won’t.

        private void textBox_KeyDown_HandleCtrlAToSelectAllText(object sender, KeyEventArgs e)
        {
            TextBox textBox = sender as TextBox;
            if (null != textBox)
            {
                if (e.Control && e.KeyCode == Keys.A)
                {
                    textBox.SelectAll();
                    e.SuppressKeyPress = true;
                }
            }
        }

–jeroen

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »

Some notes on finding the cause of a .NET app generating a “application has generated an exception that could not be handled”

Posted by jpluimers on 2012/11/15

A while ago, one of the users at a client got an error in a .NET 1.1 app of which the sources were not readily available:

“application has generated an exception that could not be handled”

I think it is a e0434f4d  exception.

This particular site has very strict rules about what you can and cannot do as a developer. Which means that on a production system, you basically cannot do anything.

A few links that should help me finding the solution, and escalate far enough upstream to get someone with local admin rights to assist me:

If WinDbg is allows to be ran, these should help me:

–jeroen

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development | Leave a Comment »

.NET Framework Libraries: downloadable source code under the Shared Source Initiative

Posted by jpluimers on 2012/09/06

So I won’t forget: .NET Framework Libraries.

It contains the download links, setup instructions (for debugging, troubleshooting and source/symbols downloading) and licensing information.

–jeroen

Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, ASP.NET, Development, Software Development | Leave a Comment »

Need some help: parsing almost well formed XML fragments: how to skip over multiple XML headers – Stack Overflow

Posted by jpluimers on 2012/08/16

If anyone knows a better solution than string search/replace, please let me know:

I’m required to write a tool that can handle the below XML fragment that is not well formed as it contains XML declarations in the middle of the stream.

The company already has these kinds files in use for a long time, so there is no option to change the format.

There is no source code available that does the parsing, and the platform of choice for new tooling is .NET 4 or newer preferably with C#.

This is how the fragments look like: Read the rest of this entry »

Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, C#, C# 2.0, C# 3.0, C# 4.0, Development, Software Development, XML, XML/XSD | Leave a Comment »

SharePoint 2010 error: Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 800703fa – SharePointWiz

Posted by jpluimers on 2011/04/11

Somehow in a production environment I did get this error too:

System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 80040154.

These two posts helped me to solve it:

SharePoint 2010 beta error: Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 800703fa – SharePointWiz – Site Home – MSDN Blogs.

Rhythmic Coding: Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 80040154.

The solution is deceptively simple:

Resolution: It is because you are trying to build a x86 application. Go to project properties and set type to x64 everywhere. Then rebuild and debug. The Error Vanishes!

The SharePoint 2010 dll’s are all x64, and Visual Studio 2010 by default still starts .NET projects in x86 mode for both Release and Debug settings.

–jeroen

Posted in .NET, .NET 4.0, C#, C# 4.0, Development, SharePoint, Software Development, Visual Studio 2010, Visual Studio and tools, Web Development | 8 Comments »

Some #reflector URLs

Posted by jpluimers on 2011/02/17

While it is still free…

The current version: http://reflector.red-gate.com/Reflector.zip

The “Check for Updates” entry in the “Help” menu checks this URL: http://reflector.red-gate.com/Reflector.version

Which currently returns:

6.6.0.30
6.1.0.0
http://reflector.red-gate.com/Download.aspx?File=Reflector&Client={Client}&Version={Version}

When Reflector detects there is a new version, you get a dialog like this:

—————————
.NET Reflector
—————————
A new version of .NET Reflector is available. Do you want to install automatically?
—————————
Yes No
—————————

When you press [Yes], it starts downloading from a URL that depends on the current version: http://reflector.red-gate.com/Download.aspx?File=Reflector&Client=Reflector&Version=6.5.0.135

{Client} was replaced by Reflector, and {Version} was replaced by 6.5.0.135 (the version of the currently running Reflector).

–jeroen

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, .NET CF, Development, Software Development | 1 Comment »