.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 ‘Framework’

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.

Description of the documentation error in the “HttpServerUtility.Transfer Method (String, Boolean)” topic in the Microsoft Developer Network

Symptoms
This article describes the undocumented change in behavior of the HttpServerUtility.Transfer method call from the Microsoft .NET Framework 1.0 to the Microsoft .NET Framework 1.1.
For more information, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/aa332847(VS.71).aspx(http://msdn2.microsoft.com/en-us/library/aa332847(VS.71).aspx)
Resolution
The HttpServerUtility.Transfer method contains two parameters. The first parameter is a URL path of the new page on the server to execute.The second optional parameter indicates whether the Form and the QueryString values can pass from the calling page to the page that the user is being transferred to.

HttpServerUtility.Transfer(String, Boolean); In the .NET Framework 1.0, if the second optional parameter of the HttpServerUtility.Transfer method is not specified, the second parameter is set to false.
In the .NET Framework 1.1, if the second optional parameter of the HttpServerUtility.Transfer method is not specified, the second parameter is set to true.
The “Parameters” section of the “HttpServerUtility.Transfer Method (String, Boolean)” topic in MSDN states the following:
path
The URL path of the new page on the server to execute.
preserveForm
If true, the QueryString and Form collections are preserved. If false, they are cleared. The default is false.
The following is the correct information:
path
The URL path of the new page on the server to execute.
preserveForm
If true, the QueryString and Form collections are preserved. If false, they are cleared. In the .NET Framework 1.0, the default value of the preserveForm parameter is false. In the .NET Framework 1.1, the default value of the preserveForm parameter is true.

Description of the .NET Framework 1.1 post-Service Pack 1 hotfix rollup package for System.windows.forms.dll

Symptoms
This article describesthe Microsoft.NET Framework 1.1 issues that are fixed in the .NET Framework 1.1 post-Service Pack 1 hotfix rollup package for System.windows.forms.dll.
Issues that are fixed in the hotfix packageFor more information, click the following article number to view the article in the Microsoft Knowledge Base:
875434?(http://support.microsoft.com/kb/875434/) FIX: You receive a NullReferenceException exception when you manually set a Control ID in the .NET Framework 1.1
840503?(http://support.microsoft.com/kb/840503/) FIX: The scroll bar may not show the correct position in a spreadsheet in a Windows Forms application in the Microsoft .NET Framework 1.1
841096?(http://support.microsoft.com/kb/841096/) Validation event does not fire for Microsoft Windows Forms controls
873429?(http://support.microsoft.com/kb/873429/) FIX: A gradual memory leak occurs in a WinForm application when you create, modify, or remove a MenuItem property for an MDI form in the .NET Framework 1.1
884579?(http://support.microsoft.com/kb/884579/) FIX: The Click event for a button in a UserControl control occurs even though another UserControl control is set to cancel form validation in a Microsoft Windows Forms application that is built on the Microsoft .NET Framework 1.1
886802?(http://support.microsoft.com/kb/886802/) FIX: You may receive the “AxImp error object reference not set to an instance of an object” error message when you run AxImp.exe on an ActiveX control in the .NET Framework 1.1
886686?(http://support.microsoft.com/kb/886686/) FIX: You can close a form by using the Close button even if the Cancel property of a Validating event is set to True on an object in a Windows Forms application in the .NET Framework 1.1
885446?(http://support.microsoft.com/kb/885446/) FIX: You may experience unexpected behavior when you press TAB or ENTER in a Windows Form on a computer that is running the .NET Framework 1.1 S885446
Resolution
Hotfix informationA supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next .NET Framework 1.1 service pack that contains this hotfix.
To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=support(http://support.microsoft.com/contactus/?ws=support)NoteIn special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.PrerequisitesYou must have the.NET Framework 1.1 Service Pack 1 (SP1) installed to apply this hotfix.Restart informationYou do not have to restart your computer after you apply this hotfix.Hotfix replacement informationThis hotfix is not replaced by any later hotfix.Registry informationYou do not have to create or to modify any registry keys to activate any hotfixes that are contained in this package.Hotfix file informationThis hotfix contains only those files that you must have to correct the issues that this article lists. This hotfix may not contain of all the files that you must have to fully update a product to the latest build.
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.

DateTimeVersionSizeFile name———————————————————————07-Oct-200421:461.1.4322.20382,052,096System.windows.forms.dll

BUG: An “Object reference not set to an instance of an object” error occurs when you try to access data by using ADO Interop on an ASP.NET page

Symptoms
On a computer that has Microsoft .NET Framework 1.0 installed (and that does not have Microsoft Visual Studio .NET installed), when you try to access data using ADO Interop on an ASP.NET page that resides at an identical site and that is hosted on the same computer, you may receive the following error message:

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Resolution
To resolve this problem, register the Adodb.dll file in the global assembly cache (GAC). On a computer where only the .NET Framework is installed, the file Gacutil.exe does not exist.. Either obtain the gacutil file by installing Microsoft .NET Framework SDK, or create a Visual Studio.NET setup project that uses the installer to install the correct components.
To register Adodb.dll in the GAC, follow these steps: Click Start and then click Run. In the Run dialog box, type the following command, and then click OK:
C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\gacutil /i C:\Program Files\Microsoft.NET\Primary Interop Assemblies\adodb.dll

BUG: A BadImageFormatException exception may occur when you use a recursively defined constraint of a generic type in a .NET Framework 2.0-based application

Symptoms
In a Microsoft .NET Framework 2.0-based application, you use a recursively defined constraint ofa generic type. When you do this, a BadImageFormatException exception may occur at run time. This problem occurs only in certain scenarios.
Resolution
This problem occurs because of an issue in the Microsoft Visual Studio 2005 common language runtime (CLR 2.0) components.

Availability of the .NET Framework 1.1 post-Service Pack 1 hotfix rollup for MsCorLib.dll, for MsCorSvr.dll, and for MsCorWks.dll

Symptoms
This article lists the Microsoft .NET Framework bugs that are fixed in the .NET Framework 1.1 post-Service Pack 1 hotfix rollup for MsCorLib.dll, for MsCorSvr.dll, and for MsCorWks.dll. Each package contains all the fixes that were released in the previous .NET Framework rollup packages.

Issues that are fixed in the hotfix packageThe following issues are fixed in this hotfix package.
843055?(http://support.microsoft.com/kb/843055/) FIX: You cannot emit embedded managed resources with the reflection Emit API in the Microsoft Common Language Runtime 1.1
820745?(http://support.microsoft.com/kb/820745/) Failfast occurs when you experience an “out of memory” condition
839611?(http://support.microsoft.com/kb/839611/) FIX: An access violation occurs when an AppDomain.Unload method is unloading in the .NET Framework 1.1
842768?(http://support.microsoft.com/kb/842768/) FIX: You may not be able to log on to Windows 2000 if the .NET Framework 1.1 is installed
843072?(http://support.microsoft.com/kb/843072/) FIX: You experience a System.IndexOutOfRangeException error or a System.NullReferenceException error when you use the Queue object in the .NET Framework 1.1
843561?(http://support.microsoft.com/kb/843561/) FIX: System.Threading.Timers Class Library may unexpectedly run in the .NET Framework 1.1
870724?(http://support.microsoft.com/kb/870724/) FIX: Setting the address of the static field of a thread to the local managed pointer does not set the value of the local managed pointer in the Common Language Runtime 1.1
884541?(http://support.microsoft.com/kb/884541/) FIX: You cannot use the IDispatch interface on the AppDomain object after you install the .NET Framework 1.1 Service Pack 1
884543?(http://support.microsoft.com/kb/884543/) FIX: You receive an “Exception System.Security.SecurityException” error message when you host a .NET Windows Forms control in a browser window on a computer that has the .NET Framework 1.1 Service Pack 1 installed
884895?(http://support.microsoft.com/kb/884895/) FIX: On multiple-processor computers, garbage collection takes longer than expected in the .NET Framework 1.1 Service Pack 1
843294?(http://support.microsoft.com/kb/843294/) FIX: A System.ExecutionEngineException error occurs on a computer where the .NET Framework 1.1 is installed when you try to import a COM type library
885454?(http://support.microsoft.com/kb/885454/) FIX: Impersonation may not work when you call a .NET remote object from a server that is running IIS together with the .NET Framework 1.1 Service Pack 1
886701?(http://support.microsoft.com/kb/886701/) FIX: The J# class library ZipEntry.getTime() method returns a modification time that is incorrect in Visual Studio .NET 2003
Resolution
Hotfix informationA supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next .NET Framework 1.1 service pack that contains this hotfix.
To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=support(http://support.microsoft.com/contactus/?ws=support)NoteIn special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.
PrerequisitesTo apply this hotfix, you must have Microsoft .NET Framework 1.1 Service Pack 1 installed on the computer.
Restart informationYou must restart the computer after you apply this hotfix.
Hotfix replacement informationThis hotfix is not replaced by any later hotfix.
Registry informationYou do not have to create or modify any registry keys to apply any hotfixes that are contained in this package.
Hotfix file informationThis hotfix contains only those files that you must have to correct the issues that this article lists. This hotfix may not contain all the files that you must have to fully update a product to the latest build.
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.

DateTimeVersionSizeFile name————————————————————–07-Dec-200420:271.1.4322.20532,138,112Mscorlib.dll07-Dec-200420:271.1.4322.20532,519,040Mscorsvr.dll07-Dec-200420:301.1.4322.20532,506,752Mscorwks.dllNoteThe other version and the corresponding English version of this hotfix have the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

DateTimeVersionSizeFile name————————————————————–17-Nov-200406:571.1.4322.20482,138,112Mscorlib.dll16-Nov-200403:281.1.4322.20482,514,944Mscorsvr.dll07-Dec-200403:291.1.4322.20482,506,752Mscorwks.dll