Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
|
Source File: c:inetpubwwwrootwebparserwgramc.cs Line: 38
Stack Trace:
|
Replies (11)
But hang in there plss..
This is the problem... I have a running window application with the dll import code and it's running smoothly... then I decided to convert it to web application...
I got this four dll import code...
[DllImport("link41a.dll", EntryPoint="Init", CallingConvention=CallingConvention.StdCall)]
public static extern int Init(string dict, string knowledge, string constituent_knowledge, string affix);[DllImport("link41a.dll", EntryPoint="Parse", CallingConvention=CallingConvention.StdCall)]
public static extern string Parse(string input);[DllImport("link41a.dll", EntryPoint="ParseDiagram", CallingConvention=CallingConvention.StdCall)]
public static extern string ParseDiagram(string input);[DllImport("link41a.dll", EntryPoint="Release", CallingConvention=CallingConvention.Winapi)]
public static extern void Release();then i have this weird problem...
Server Error in '/webParser' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
|
Source File: c:inetpubhttp://www.kdkeys.net/object-reference-not-set-to-an-instance-of-an-object/#link-6821 Line: 254
Stack Trace:
|
PLEASE HELP ME...
GEEZMOH :
Put the Link41a.dll in your System Folder (System32)
Change the calls to Link41a.dll to refer to the full path of the dll e.g. C:WINNTSYSTEM32LINK41A.DLL
Finally please give me a feedback [H] if it works.
Thanks
I just did what u told me too...But i got the same problem...by the way the wGramC.Init is working why the other like the Parse didn't work...What do u mean by "Change the calls to Link41a.dll to refer to the full path of the dll e.g. C:WINNTSYSTEM32LINK41A.DLL"I will re code the dll??Please be patient with me... Thnx a lot.. please help me...
Geezmoh :
Leave the dll file in the local bin directory (not system32).
Change the DllImport line to look like :
[DllImport("c:inetpubhttp://www.kdkeys.net/object-reference-not-set-to-an-instance-of-an-object/#link-6975" .....
Kingsley Tagbo
[DllImport("C:/Inetpub/http://www.kdkeys.net/object-reference-not-set-to-an-instance-of-an-object/#link-6976", EntryPoint="Release", CallingConvention=CallingConvention.StdCall)]
I got the same problem I think the import is working because I don't have any problem in
[DllImport("c:/windows/system32/link41a.dll", EntryPoint="Init", CallingConvention=CallingConvention.StdCall)] public static extern int Init(string dict, string knowledge, string constituent_knowledge, string affix); hmm any Idea in mind.. Sorry for the time you spent but please don't leave me...
Thnx A lot.... I hope you have any solutions our there.
Can you try replacing all calls to DllImport("CLink41a.dll" to DllImport("c:/windows/system32/link41a.dll" or whatever the ful path to your dll is.See these references : http://www.kdkeys.net/object-reference-not-set-to-an-instance-of-an-object/#link-6977http://www.kdkeys.net/object-reference-not-set-to-an-instance-of-an-object/#link-6978
Please do one thing for me.Please post the description of your solution and then vote on the thread according to how you feel about this post.Thanks a lot.
this is the code that i do for my dll import...
[DllImport("link41a.dll", EntryPoint="Parse", CallingConvention=CallingConvention.StdCall)]
I got the same problem... Please help..
Ask A Data Miner - 75,000+ Members
Follow On Twitter
Request More Information
Your DllImport may not be creating an object to start with.
After your DllImport and before you call wGramC.Parse, check if the object is valid :
E.g.
[code language="c#"]
if (wGramC != null)
{
wGramC.Parse ...
}
else
{
System.Diagnostics.Debug.WriteLine("null wGramC Object ...");
}[/code]