c# - 'Method not found' error with Windows Service -
i have windows service written in c# using vs2012 , 4.5 framework. service consists of 2 other projects objects databases, use .edmx files , ef5.
edmx projects:
mycompany.data.masterdb
mycompany.data.statstracker
the service makes 2 calls methods within itself; 1 generates list of files process , if there more 0, returns true, otherwise false.... , other method process these files.
//only proceed if there files process. if (generatefilelist()) processlogs();
the 2nd method (called processlogs
) try use context other projects , getting following error:
method not found: 'system.data.entity.dbset1<mycompany.data.masterdb.statisticlogtype>mycompany.data.masterdb.masterdbcontext.get_statisticlogtypes()'.
here's few lines of processlogs
method (this wrapped in try/catch):
statisticlogtype duplicateslogtype; statisticlogtype successlogtype; masterdbcontext sccontext = new masterdbcontext(); statstrackercontext utcontext = new statstrackercontext(); //i believe error coming from: successlogtype = sccontext.statisticlogtypes .where(s => s.statisticlogtypeid == (int)statisticlogtypes.logtypes.success).firstordefault<statisticlogtype>(); duplicateslogtype = sccontext.statisticlogtypes .where(s => s.statisticlogtypeid == (int)statisticlogtypes.logtypes.duplicates).firstordefault<statisticlogtype>();
statisticlogtypes.logtypes
static enum class residing in masterdb
object:
public static class statisticlogtypes { public enum logtypes { corruptfile = 1, success = 2, duplicates = 3, locationnotfound = 4, systemnotfound = 5, badfilenameformat = 6, uploaded = 7, filenotfound = 8, invalidfileextension = 9 } }
sorry it's bit scattered, i'm trying not leave out.....so project compiles , builds , can install using installshield lite fine. when run , attach vs debugger it, see goes through generatefilelist()
method fine, try walk through processlogs()
, error. doesn't let me step through processlogs()
method line line, found weird.
at rate, i've done ton of research trying figure out issue can't seem find anything. i've made sure projects on same .net framework version hasn't helped.
any or direction great. has me stumped , i've been trying find resolution days now.
btw, meant add added testunit project , put logic service , able run without issues.
turns out joachim onto something. dll older reference not accident more fault installshield le built vs2012. project referencing correct dll , when building setup project, made sure select output project when being built, referencing older version of dll. no matter how many times deleted setup project , recreated it, kept older reference. ended removing project created dll , recreating different name, installshield picked correct dll , worked.
hope helps else!
Comments
Post a Comment