Skip to main content

Ronn Black's Library tagged googlenotebook   View Popular

20 Jul 09

Hosting Multiple Web Applications

  • Note   If you host an ASP.NET Web application built using the .NET Framework version 1.0, the process account needs appropriate permissions to the root of the current file system drive. For more information, see Microsoft Knowledge Base article 317955, "FIX: 'Failed to Start Monitoring Directory Changes' Error Message When You Browse to an ASP.NET Page."

List of Microsoft Support Knowledge Base Articl...

A Performance Comparison of Windows Communicati...

  • Windows Communication Foundation (WCF) is a distributed communication technology that ships as part of the .NET Framework 3.0. This article concentrates on comparing the performance of WCF with existing .NET distributed communication technologies.
  • The throughput performance of WCF is better than ASMX by 19%, 21% and 36% for 1, 10 and 100 objects in a message, respectively

Gmail: Email from Google

  • Gmail is a new kind of webmail, built on the idea that email can be more intuitive, efficient, and useful. And maybe even fun. After all, Gmail has: ...

JSTOR: The Language Game: The Death of Whom?

  • Don't worry over your choice, don't ask anyone for help, and above all don't .... not sure from whom it came," instead of the natural-sound- ing, "I'm not ...

DetailsView Data Binding

  • 1. We still use the DetailsView control's buildin updating mechanism, but
    use the ItemUpdating event to proprocess the update operation. The
    ItemUpdating event, we can get the paramters that will be used to do the
    updating operation and then use them to perform our own update operation.
    And we can use the
    DetailsViewUpdateEventArgs.Cancel to cancel the buildin update operation.

GridViewGuy

  • private void BindData()

    {

    DataSet ds = new DataSet();

    if (Cache["DataSet"] == null)

    {

    SqlConnection myConnection = new SqlConnection(ConnectionString);

    SqlDataAdapter ad = new SqlDataAdapter("SELECT * FROM Users", myConnection);

    ad.Fill(ds);

    Cache["DataSet"] = ds;

    }

    fv1.DataSource = (DataSet)Cache["DataSet"];

    fv1.DataBind();

    FormViewRow row = fv1.Row;

    GridView gv = row.FindControl("gv1") as GridView;

    gv.DataSource = (DataSet) Cache["DataSet"];

    gv.DataBind();

    }

ASP.NET Session State FAQ

    • InProc - Fastest, but the more session data, the more memory is consumed on the web server, and that can affect performance.
    • StateServer - When storing data of basic types (e.g. string, integer, etc), in one test environment it's 15% slower than InProc. However, the cost of serialization/deserialization can affect performance if you're storing lots
      of objects. You have to do performance testing for your own scenario.
    • SQLServer - When storing data of basic types (e.g. string, integer, etc), in one test environment it's 25% slower than InProc. Same warning about serialization as in StateServer.
    • StateServer
      • - In a web farm, make sure you have the same in all your web servers. See KB 313091 on how to do it.
      • - Also, make sure your objects are serializable. See KB 312112 for details.
      • - For session state to be maintained across different web servers in the web farm, the Application Path of the website (For example \LM\W3SVC\2) in the IIS Metabase should be identical in all the web servers in the web farm. See KB 325056 for details

PerfMon - Your debugging buddy » Advanced .NET ...

  • # Bytes in all heaps - This counter is the sum of four other counters: Gen 0 Heap Size, Gen 1 Heap Size, Gen 2 Heap Size and Large Object Heap Size. It displays the current memory allocated in bytes on the GC (managed) heaps.

    If this counter keeps on rising it indicates that we have a managed leak. Some managed objects are always being refereneced and are never collected.

    # GC Handles - Displays the current amount of GC handles in use. GCHandles are handles to external resources to the CLR and managed environment. They occupy small amounts of memory on the GC heap but potentially expensive unmanaged resources hide behind them.

    If this counter keeps on growing in addition to the private bytes (we will talk about this counter later on), it means that we are probably referencing unmanaged resources and not releasing them causing a memory leak.

  • # Total reserved Bytes - This counter shows the total amount of virtual memory (in bytes) currently reserved (not committed) by the Garbage Collector.

    In addition to what I’ve mentioned above in # Total committed Bytes, this counter, when increasing over a large period of time, might also suggest fragmentation of the virtual address space. This situtaion is usually common in a mixed application that has a lot of managed and unamanged code tangled together and effectivly will limit your application’s total life time before commiting application suicide.

    NOTE: Virtual address space fragmenetation may also occur natually (in unmangaed code or in a mixed managed/unmanaged application) due to the nature of your application’s memory allocation profile, so not every increasing in reserved bytes might indicate that.

DataSet Serialization - Dino Esposito's WebLog

  • The DataSet object implements ISerializable meaning that it provides for its own serialization format and data layout. And it does that using plain XML. (Not even blanks and tabs are removed.) As a result, when you remote a DataSet you are actually passing data using a large chunk of data made after a verbose schema--the DiffGram. No matter you use a binary channel and formatter.

    This point is well addressed in the following KB article. Which, in turn, references an MSDN Magazine article of mine for further details. Both articles illustrate some workaround, the best of which I believe is using a compact-formatter that just zips everything being transferred.

    The good news is that this seems to be fixed in 2.0. A new property--RemotingFormat--on DataSet and DataTable objects makes possible for you to interact with the implementation of ISerializable and choose a binary format to optimize performance in .NET Remoting scenarios.

Cutting Edge: Binary Serialization of ADO.NET O...

  • No ADO.NET classes declare themselves as serializable, and only DataSet and DataTable implement the ISerializable interface. For example, you can't serialize a DataColumn or a DataRow object to any .NET Framework formatters. As mentioned earlier, sometimes surrogate types represent a system-provided, application-specific workaround for such a problem—that is, making relatively simple non-serializable types serializable to .NET formatters. But let's first briefly recall the key aspects of .NET runtime serialization.Implementing ISerializable
  • The DataTable class doesn't provide the same WriteXml method to persist its contents to XML. This means that if you have a standalone DataTable object, which is an object that's not included as a child in any parent DataSet object, you must resort to a trick to have it persisted as XML.
    When you persist a DataSet object to XML, any contained DataTable object is rendered as XML, but the necessary methods are not publicly available. To work around the issue, you simply create a temporary, empty DataSet object, add the table to it, and then serialize the DataSet object to XML.
  • 1 more annotations...

Improving DataSet Serialization and Remoting Performance

  • You can greatly improve serialization and remoting performance for larger DataSets by using a correctly designed surrogate type or serialization wrapper classes. For more information about using a surrogate mechanism or a wrapper mechanism (or both) with the .NET Framework DataSet class, visit the following Microsoft Developer Network (MSDN) Web site:
  • This article contains a sample serialization wrapper class that is optimized to more efficiently serialize and deserialize larger DataSets. The class significantly reduces transient memory allocations versus remoting a typical DataSet. Large reductions in the transient memory allocations also improve remoting end-to-end time and improve scalability when using a larger DataSet.

ASP.NET Session State

  • Out-of-process Mode

    Included with the .NET SDK is a Windows® NT service: ASPState. This Windows service is what ASP.NET uses for out-of-process session state management. To use this state manager, you first need to start the service. To start the service, open a command prompt and type:

    net start aspstate

    What you'll see is:

    Figure 1. Starting the Windows NT service ASPState at the command prompt

    At this point, the Windows NT Service ASPState has started and is available to ASP.NET. Next, we need to configure ASP.NET to take advantage of this service. To do this we need to configure config.web:

    We changed only from inproc mode to stateserver mode. This setting tells ASP.NET to look for the ASP state service on the server specified in the server and port settings—in this case, the local server.

    We can now call SessionState.aspx, set a session state value, stop and start the IIS process (iisreset), and continue to have access to the values for our current state.

TopXML : Surrogate Selectors (.NET Framework)

  • A surrogate selector object has to implement the ISurrogateSelector interface (table 12.8) to interact with the runtime serialization formatters of the .NET Framework. The interface defines the GetSurrogate() method to retrieve serialization surrogates by object type and serialization scenario.

  • To register one or more selectors, the formatter exposes a property named SurrogateSelector. With surrogate selectors registered, the formatter iterates over all selectors to find a surrogate for the object type it has to process in the given context. If it can locate an appropriate surrogate it delegates serialization to the surrogate. Figure 12.1 illustrates this interaction between the formatter, the surrogate selector and the serialization surrogate.

  • 1 more annotations...

CodeProject: A Fast/Compact Serialization Frame...

  • Application objects can be integrated with the framework in two ways. By writing a surrogate for the object type and registering the surrogate with the framework, or by implementing INxSerializable. The framework provides a built-in surrogate for types that implement INxSerializable. For unknown types, native .NET serialization is used.

.NET Column: Run-time Serialization, Part 3

  •    ss.AddSurrogate(typeof(Car),       new StreamingContext(StreamingContextStates.All),       new CarSerializationSurrogate());   // NOTE: AddSurrogate can be called multiple times to register   // more types with their associated surrogate types   // 5. Have the formatter use our surrogate selector   formatter.SurrogateSelector = ss;
  • NET Framework remoting architecture also allows code that is not part of the type's implementation to override how a type serializes and deserializes its objects. There are two main reasons why application code might want to override a type's behavior. First, it provides you the ability to serialize a type that was not originally designed to be serialized. And second, you can provide a way to map one version of a type to a different version of a type.
    Basically, to make this mechanism work, you first define a "surrogate type" that takes over the actions required to serialize and deserialize an existing type. Then you register an instance of your surrogate type with the formatter, telling the formatter which existing type your surrogate type is responsible for acting upon. When the formatter detects that it is trying to serialize or deserialize an instance of the existing type, it will call methods defined by your surrogate object. I'll build a sample that demonstrates how all this works.

ASP.NET.4GuysFromRolla.com: Persisting Page Sta...

  • It is possible, however, to persist view state to an alternate medium. Such customizations were possible in ASP.NET version 1.x by overriding a couple of methods in the Page class. ASP.NET 2.0 makes customizing page state persistence easier as this logic is handled through a separate class. In this article we'll explore the built-in page state persistence options in ASP.NET 2.0, which includes the ability to persist page state to session state rather than through a hidden form field. We'll also look at how to extend the functionality to provide a custom persistence scheme. Read on to learn more!

1 - 20 of 324 Next › Last »
Showing 20 items per page

Diigo is about better ways to research, share and collaborate on information. Learn more »

Join Diigo