Skip to content

Flauschig Dev. Blog

I program therefore I am

  • Home
Expand Search Form

How to disable the Asp.Net Debugging Timeout

Roemer Wednesday, 1. April 2009 0

When developing Web-Applications with Asp.Net, you often run the Page with your Debugger and want to step thru the Code. If you hold too long on a line (default is 90 Seconds) you’ll get a Timeout and the Debugging stopps.

Here’s how you can disable that the Debugger stopps:

  • Open the IIS Manager
  • Go to the Application Pools
  • Right-Click your Application Pool and select “Advanced Settings…”
  • Search the Setting “Ping Enabled” under “Process Model”
  • Set it to “false”
  • Press Ok
  • If you get an “insufficient permissions” Error or something, try to clear the “Read only” Flag from that File you see in the error Message.

That’s it. You can now debug as long as you want without getting a Timeout.

Categories ASP, Programming Tags Debugging, Disable, Timeout

Escape invalid XML Chars

Roemer Friday, 27. March 2009 0

When working with XML, you sometimes want to save some Text into the XML.
That can lead to problems when you use special Chars which then confuses the XML Parser.

To fix that you could just use multiple Replaces over your String or just use the .Net Function:
System.Security.SecurityElement.Escape

Example:

string myText = "Hello & World! <3";
string myTextXMLSafe = System.Security.SecurityElement.Escape(myText);
// myTextXMLSafe is now "Hello &amp; World! &lt;3"
Categories C#, Programming Tags Escape, XML

Anonymous Types and Generics

Roemer Thursday, 5. March 2009 0

C# 3.0 has a “nice” Feature called “Anonymous Types”.

Basically it is great for LINQ where you want to create a Type on the fly.
To create such a Type just use

var myAnonymousObject = new {
    Firstname = "John",
    Lastname = "Doe"
};

Now you possibly want to extend that a little and have a Function return a List of such a Type.
You can’t use List<T> because you don’t know the Type. You could use a List<object> but that’s not nice. It’s better to use a Feature called “Casting by Example”.

An Example Function implementing this Feature could look like:

public List<T> GetList<T>(T exampleObject)
{
    List<T> newList = new List<T>();
    // TODO: Fill the List somehow
    return newList;
}

You can then call this Function like this:

var someList = GetList(
    new {
        Firstname = "",
        Lastname = ""
    }
);
Categories C#, Programming Tags Anonymous, Casting, Example, Generic, Type

Regex Tips

Roemer Tuesday, 17. February 2009 0

Since I always forget some important things about Regex, I’ll write it down here:

Greedy vs Non-Greedy
If you have something like “hello|world|!” and you want to get only the first part before the first Delimiter (which obviously is “|”) your first try could look like:
(.*)\|
That one would match “hello|world” since by default Regex is Greedy (aka. “take as much as possible”).

The old-fashioned way was:
([^\|]+)
This one does match unless the “|” Sign is found.

Now Regex has a much nicer solution:
(.*?)\|
The added “?” makes it Non-Greedy (aka. “take as less as possible)

Non-Capturing Group
Sometimes you want to create a Group which is not captured. Just begin those Groups with an “?:” and it will not get captured.
Example:
(?:abc)

Categories General, Programming Tags Greedy, Group, Non-Capturing, Regex

Thread Safe Singleton Pattern

Roemer Thursday, 12. February 2009 0

Singletons can be great. But it’s important to make sure that the Singleton really is a Singleton, even in a Multi-Threading Environment.

There are multiple possibilities to achieve this and here are my Favorites: Continue reading Thread Safe Singleton Pattern

Categories C#, Programming Tags Double Locking, Lazy, Multi-Threading, Pattern, Singleton, Static, Thread Save

Better Type.GetMethod()

Roemer Tuesday, 6. January 2009 1

Getting a Generic MethodInfo with “Type.GetMethod()” is not really possible. That’s why I wrote this little Function which helps finding any Methods and return it’s correct MethodInfo on which you then can Invoke on. Continue reading Better Type.GetMethod()

Categories C#, Programming Tags Generic, GetMethod, MethodInfo, Type

“ORDER BY” specific order

Roemer Wednesday, 19. November 2008 0

Let’s say you have a Select Statement with a List of IDs in it’s “IN()” Part and want to get the Results in the same Order as the List of IDs.

You now could use the same “ORDER BY” you used when you got the List of IDs but why reordering if you already got the order?

Or you could reorder the result in your application.

But there’s another solution to order it in SQL. Using the “CASE-WHEN-THEN” Statement. It may not be very efficient if you have many IDs but that’s the best I found. Continue reading “ORDER BY” specific order

Categories C#, Programming, SQL Tags Generate, IN, Order

Yield and Return

executor Tuesday, 21. October 2008 0

No, this is not a post about the current state of the worlds financial industries, instead it is about one of the lesser known C# features called “yield” that can be used to create dynamic collections. It is one of the more disputed features of C# because it is “not really object oriented” and more of a hack than anything else. While this is most likely true, I find it hard to argue its usability. See for yourself.
Continue reading Yield and Return

Categories C# Tags Feature, On the fly

@icon sushi

Samuel Wednesday, 15. October 2008 0

Auf der suche nach einem Tool welches mir die gewünschten Images in Icons konvertiert, bin ich auf die kleine App “@icon sushi” gestossen.  Klein und Kompakt kann “@icon sushi” das was man im Alltag benötigt wenn es um die Konvertierung von Icons geht.
Zur Seite: “@Icon sushi”

Categories Tools Tags Tools

Floats und nachfolgende Elemente

Roemer Wednesday, 8. October 2008 0

Elemente mit style="float:right;" oder style="float:left;" zu positionieren kann gefährlich sein.
Das Problem ist, dass ein Element nach dem float versucht, sich daneben / dazwischen zu positionieren.
Um zu unterbinden dass ein Element sich neben einem Floating-Element positioniert muss man diesem style="clear: both;" zuweisen. Continue reading Floats und nachfolgende Elemente

Categories HTML / CSS, Programming Tags Float, HTML, Style
Previous 1 2 3 … 7 8 9 10 11 Next

Categories

  • Azure (1)
  • Fun (3)
  • Programming (71)
    • ASP (9)
    • C# (37)
    • General (5)
    • HTML / CSS (5)
    • PHP (2)
    • SQL (4)
    • WPF (2)
    • XML (2)
    • XNA (2)
  • Tools (22)
    • PowerShell (3)
    • VisualStudio (7)
  • Uncategorized (17)

Authors

  • Roemer
  • executor
  • Samuel
  • against

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Tag Cloud

4.0 Binding BrowseForFolder Comic Control DataObject DateTaken DigiCam Digital Camera DragDrop Dynamic Files formatting Generic Hover Image launchy Logitech macros Metadata Model Multithreading MySQLi Parameter Portable Device powershell powershell formatting PreventAutoID prevent auto ID productivity project references references reflection SDK Shell32 Table Tools Type View ViewModel Visual Studio VS VS macros WCF XNA

Views

  • PHP, MySQLi and Dynamic Parameter Binding - 291,976 views
  • ASP.NET Postback to new Window or Popup - 41,036 views
  • Copy/Move Files from Portable Device - 38,191 views
  • Fix “The following Web projects must be converted to the new Web Site format.” Error - 29,269 views
  • Custom Diff/Merge Tools in Team Foundation - 27,850 views
  • ASP.NET 4 BrowserCaps (or: what were they thinking?) - 25,844 views
  • Win7 Boot from VHD – Part II - 23,942 views
  • Wake on Lan (WOL) with Asus z-97 Deluxe and Windows 8.1 / 10 and Synology Diskstation - 17,136 views
  • Get full page screenshot with ChromeDriver 2 - 16,148 views
  • Facebook Sliding Like Box Script - 11,490 views

Users Online

1 User Online

Flauschig Dev. Blog © 2025