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

DEFECT ERROR: Object Reference not set to an Instance of an Object

Symptoms
“Object reference not set to an instance of an object” This error occurs when generating a report for a company that has been deleted from within FRx.
Resolution
This SMR has been fixed in R04670 Service Pack, please check our website () for availability of Service Packs for your General Ledger. You may also sign up for automatic notification of Services on our website .

BUG: FIX: VBScript Can Corrupt Data Stored in Scripting Dictionary Object

Symptoms
If you assign Request.Form or QueryString items in a Scripting Dictionary object cached in Session scope, you will corrupt your data. Corrupted data will manifest either as empty fields (that is, blank individual dictionary items) or as items containing garbage text.
Resolution
VBScript does not use IDispatch to fetch the Response object’s default property. This results in an object reference being assigned to an Item in the Dictionary (even when the assignment in your script does not use the Set statement). When this object reference is then cached with Session scope, a related bug in Active Server Pages (ASP) doesn’t catch and block the object reference (see 216825?(http://support.microsoft.com/kb/216825/EN-US/) “BUG: Assignment of Multi-valued Objects in Request Object Causes Corruption in Scripting Dictionary” for details).

BUG: Internal Compiler Error C1001 When You Call __assume()

Symptoms
When a function that expects STL::string as a reference is passed as an input argument to the __assume function, you may get the following error message:

repro.cpp(18): fatal error C1001: INTERNAL COMPILER ERROR
(compiler file ‘E:\8447\vc98\p2\src\P2\main.c’, line 494)
Please choose the Technical Support command on the Visual C++Help menu, or open the Technical Support help file for more information.Please refer to the “More Information” section for the sample code that reproduces the problem.
Resolution
Use one of the following two methods to work around this problem:Construct a temporary STL::string object and pass this object as a reference to the function (see workaround 1 in the sample code).Introduce a temporary variable to store the return value of the function, which expects STL::string as reference (see workaround 2 in the sample code).

BUG: “Attempt to Access the Method Failed” Error Message When You Use a Reference to the Wrong Microsoft Forms 2.0 Object Library

Symptoms
In a Visual Studio .NET project that contains a reference to the Microsoft Forms 2.0 Object Library, you may receive an error message similar to the following:

System.MethodAccessException: “Attempt to access the method failed.”
Resolution
When you use the Add Reference dialog box to add a reference to the Microsoft Forms 2.0 Object Library, you may notice that two entries appear for Microsoft Forms 2.0 Object Library.Both of these entries refer to the FM20.dll file.
You must select the first Microsoft Forms 2.0 Object Library entry in the list because this is the Primary Interop Assembly (PIA) reference. If you select the second Microsoft Forms 2.0 Object Library entry, your application may not behave as expected.

ACC2000: VBA Functions Break in Database with Missing References

Symptoms
If you have a procedure that contains a Visual Basic for Applicationsfunction, and your database contains a reference to a missing objectlibrary or type library, you may receive the following error message whenyou compile your modules or run the procedure:

Compile Error:
Can’t find project or library
Resolution
Your database contains a reference to a database, type library, or objectlibrary that is marked as MISSING: <referencename> in the References dialog box.

ACC2000: References Not Imported with Objects from Another Database

Symptoms
When you import a Microsoft Access object from one database into anotherdatabase, any reference used by the object is not imported, and you mustre-create the reference in the target database. For example, if you insertan ActiveX control on a form, Microsoft Access automatically creates areference to the .ocx file for that control. If you then open anotherdatabase and import the form that contains the ActiveX control from thefirst database, the reference to the .ocx file is not imported with theform. This behavior also occurs when you export an object.
Resolution
A reference is not imported or exported with an object because it is notspecific to the object; instead, a reference is specific to the project ofa database.