.NET Questions and Solutions

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘microsoft net framework’

How to troubleshoot a memory leak or an out-of-memory exception in the BizTalk Server process

Symptoms
Memory leaks are a common issue. You may have to try several steps to find the specific cause of a memory leak or an out-of-memory (OOM) exception in Microsoft BizTalk Server. This article discusses important things to consider when you are evaluating memory usage and possible memory-related issues. These considerations include the following:
Physical RAM
Large message processing
Use of the /3GB switch
Use of custom components
Which version of the Microsoft .NET Framework the system is running
The number of processors
Resolution
This article describes how to troubleshoot a memory leak or an out-of-memory exception in the BizTalk Server process of Microsoft BizTalk Server.

FIX: You receive exception error messages when you use the StreamWriter.Flush () method or the StreamWriter.Close () method to access a file on a disk that has insufficient space in .NET Framework 1.1

Symptoms
On a computer that is running Microsoft .NET Framework 1.1, when you use the StreamWriter.Flush() method or the StreamWriter.Close() method to access a file on a disk that has insufficient space, you receive the following exception error message:

System.IO.IOException: There is not enough space on the disk.After you free up space on the disk and then try to access the file again, you receive the following exception error message:

System.IO.IOException: The process cannot access the file “C:\outputTest.txt” because it is being used by another process.
Resolution
This problem occurs if the common language runtime (CLR) does not close the file handle after you receive the first exception error message. If the file handle does not close, you cannot access the file regardless of how much space is on the disk.

FIX: You experience out of memory exception errors on a Web server that has ASP.NET 1.1 installed

Symptoms
You experience out of memory exception errors on a Web server that has Microsoft ASP.NET 1.1 installed. ASP.NET 1.1 is installed as part of the Microsoft .NET Framework 1.1 and the Microsoft .NET Framework 1.1 Service Pack 1 (SP1).
Resolution
This problem occurs because the MobileCapabilities object does not expire from the cache as expected. You can use an instance of the MobileCapabilities object to read the capabilities of the requesting browser and device.

FIX: A NullReferenceException exception may occur when you set the Table property of a DataView object in a .NET Framework 2.0 application

Symptoms
Consider the following scenario in a Microsoft .NET Framework 2.0 application:You set a DataTable object for the Table property of a DataView object.The DataTable object that you use contains fewer rows than the DataTable object that was previously set for the Table property. The DataView object is bound to a DataGrid object.In this scenario, a NullReferenceException exception may occur.
Resolution
This problem occurs because the DataView object raises a ListChanged event before the DataView object has completed the transition to the new DataTable object.The DataView object tries to access the index for a DataRow object. However, that index is no longer valid because the Table property is set to a different DataTable object.

FIX: A NullReferenceException error occurs when you use a method that has the default null value as a parameter in the .NET Framework 1.1

Symptoms
A NullReferenceException error may occur in the Microsoft .NET Framework version 1.1 when one of the following conditions is true: You use reflection to obtain a default value of a parameter out of a method that uses a default null value for a parameter.You use reflection to invoke a method that uses a default null value for a parameter.
Resolution
To resolve this problem, obtain the latest service pack for the Microsoft .NET Framework 1.1. For more information, visit the following Microsoft Web site:
http://www.microsoft.com/downloads/details.aspx?FamilyId=A8F5654F-088E-40B2-BBDB-A83353618B38(http://www.microsoft.com/downloads/details.aspx?FamilyId=A8F5654F-088E-40B2-BBDB-A83353618B38)

FIX: A NullReferenceException error occurs when you run a .NET Framework 2.0 program

Symptoms
When you run a Microsoft .NET Framework 2.0 program, aNullReferenceException error occurs, or you receive an access violation error message. If you debug the crash, you find an access violation in the MSCORJIT!emitter::emitJumpDistBind function.
Resolution
This problem occurs because of an optimization bug in the just-in-time (JIT) compiler.