In the last code, only one tap reference exemption has been provided in the last few months, but I'm not sure at all Why that's why Code is not mine, but it looks very straightforward to me.
type page type = page. Gettype (); If (_pages.TryGetValue (page type, out value)) return value; // Exception Return _pages in the following line [page type] = New MyPage (_section.Pages [page]) throws; [NullReferenceException: The object reference is not set to an instance of an object.] System. Selection. Generic.Dictionary 2.Insert (TKey key, TV value, Boolean +210 system.clocks.genic.design.aspx 2.set_Item (key of vaccine, TV value) +11 The only thing I can think of is that page type is zero when it is used as the key of a word, but apparently. The code that this call is simple:
protected override zero OnLoad (EventArgs e) {base.OnLoad (e); _mypage = GetPage ();} I also sleep The error can be with _section.page , but the section is never null and never sets anything. If .page [page] returns The null, MyPage gives the constructor just returns. So what am I missing?
I had this problem and it turned out to be related threading.
By keeping a sync lock around this line, which you can try to insert into the dictionary:
this A class-level definition should be added as:
private static object _sync = new object (); This is an insertion statement surrounded by a sync lock:
lock (_sync) {return _pages [pageType] = new MyPage (_section.Pages [page ]); } This is the post that solved this for me:
Comments
Post a Comment