C# Hashtable "object reference not set" -


i have interesting problem trying solve. have following code below function merging values html file , giving me result set. using hashtable purposes.

the function follows (please bear in mind inherited functionality , cannot changed @ present)

public static string parsetemplate(string _filename, int _numberofsomething) {   hashtable templatevars = new hashtable();   templatevars.add("nameoffile", _filename);   templatevars.add("numberofsomething", _numberofsomething);   templateparser.parser parser =        new templateparser.parser(           system.web.httpcontext             .current.server.mappath("~/docs/templatenr.htm"), templatevars);   return parser.parse(); } 

on our dev , live servers working perfectly. trying deploy app production server , "object reference not set instance of object". breaks on "hashtable templatevars = new hashtable();" line. bit puzzled. if coding problem should not work everywhere surely?

the differences between different production servers os , iis running. ie. server 2005 , iis7 vs server2003 , iis6 (which environment breaks on). both have .net framework 3.5 installed. older os , iss problem? maybe permission/memory thing? though sounds bit implausible since other .net functionality using on new production server working perfectly.

all issues regarding hashtable found, relates not being instantiated. error happens on line trying instantiate hashtable.

has had error before , if how did solve it? i'd appreciate suggestions on , i'll give try. i'll post outcome too, if else experiencing error in future.

i never got bottom of error. suggestions using remote debugging reflector pro did not work either, pointing issues virtual server website running in. checking log files showed other errors .net framework threw out.

the website moved new virtual server using iis7 , windows server 2008. worked on new environment.

this maybe not ideal solution , maybe framework re-install have solved our problem, since in process of changing on new environment (for other reasons) solution suited us.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -