.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 for the ‘nullreferenceexception’ Category

BUG: You receive an error message when you serialize a DBConcurrencyException object in ADO.NET 1.0

Symptoms
When you serialize a DBConcurrencyException object, the value of the Row property in the serialized version of the object is set to a null value and an exception occurs:

An unhandled exception of type ‘System.NullReferenceException’ occurred in app_name.exe
Additional information: Object reference not set to an instance of an object.
Resolution
Serialization support is not provided for DataRows in this version of Microsoft Visual Studio .NET.

BUG: You receive a “Type mismatch” error message when you assign a value type variable to a property through COM InterOp in Visual Basic .NET or in Visual Basic 2005

Symptoms
When you assign a value to a property of a Component Object Model (COM) object in .NET, you may receive the following error message when you run your application:

An unhandled exception of type ‘System.Runtime.InteropServices.COMException’ occurred in InterOpDemo.exe
Additional information: Type mismatch
Resolution
The problem occurs if all of the following conditions are true: You are using the COM object in early bound mode.The property in the COM object has both Set and Let methods.You are trying to pass a value type variable to that property. In early bound mode, Microsoft Visual Basic .NET and Visual Basic 2005 always call the Set method of the property if it is available. If you want to call the Let method, you must explicitly specify it.

BUG: Various errors may occur when you try to call managed code from unmanaged code in Visual C++ .NET 2003

Symptoms
You have a Microsoft Visual C++ .NET 2003 application that uses multiple application domains. When you try to call managed code from unmanaged code in a DLL that has already been loaded in another application domain, you may receive the following error message:

An unhandled exception of type ‘System.NullReferenceException’ occurred in mscorlib.dll
Additional information: Object reference not set to an instance of an object.Note In some scenarios, you may receive one of the following error messages:

DllNotFoundException

Illegal Instruction
Resolution
You may notice this problem if your application contains unmanaged code and uses multiple application domains.
For example, if you have an application that uses multiple application domains that use a set of DLLs, you can successfully load and use these DLLs in the first application domain. However, when you try to call the managed code in one of these DLLs from unmanaged code in a different (second) application domain, the behavior that is mentioned in the “Symptoms” section of this article occurs. The application does not load the managed code in the second application domain because the code has already been loaded in another application domain that is in the same process.

BUG: NullReferenceException Error When You Create a New Page

Symptoms
If you use tree view to select templates when you create a new page in the Web Client interface, you cannot see the available templates that you have rights to.
Resolution
You do not have rights to the parent template gallery. As a result, you cannot expand the parent template gallery, so you cannot see the child template gallery.

Bad subscription information can cause the Team Foundation Server application pool to recycle

Symptoms
Source: Microsoft Support
Resolution
RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION.THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.

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