469,364 Members | 2,332 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,364 developers. It's quick & easy.

"One or more errors encountered while loading the designer" is making me suicidal! :(

This BUG that is so ridiculous I can't believe they shipped 05 is making my
life hell. I have tried the various solutions found on the web and none of
them have worked thus far. What's even more troublesome is that it appears
that 05 uses these new partial classes which would makes rolling back to 03
not possible.

The error I get when trying to load my Form in the designer is as follows:
----------------------------------------------------------------------------------------------
One or more errors encountered while loading the designer. The errors are
listed below. Some errors can be fixed by rebuilding your project, while
others may require code changes.

Object reference not set to an instance of an object.

at PMD.FirmwareEditor.UIContextControls.UC_ContextCon figuration..ctor() in
C:\PMDRepository\Tools\DQ_Tools\FirmwareEditor\tru nk\UIContextControls\UC_ContextConfiguration.cs:li ne
142
----------------------------------------------------------------------------------------------

Now I don't see any problems with the code indicated in the above error. I
have no idea why this is happening or how to fix it. I really hope that
someone has solved this or knows of a workaround. :(


Jan 22 '06 #1
3 10081
Sounds like something may be going wrong when the designer is attempting to
create an instance of the UC_ContextConfiguration control. Have you gone
through the constructor for the UC_ContextConfiguration class to see if
something might be causing an exception?

--
Tim Wilson
..NET Compact Framework MVP

"sklett" <as**@fkd.com> wrote in message
news:uY**************@tk2msftngp13.phx.gbl...
This BUG that is so ridiculous I can't believe they shipped 05 is making my life hell. I have tried the various solutions found on the web and none of them have worked thus far. What's even more troublesome is that it appears that 05 uses these new partial classes which would makes rolling back to 03 not possible.

The error I get when trying to load my Form in the designer is as follows:
-------------------------------------------------------------------------- -------------------- One or more errors encountered while loading the designer. The errors are
listed below. Some errors can be fixed by rebuilding your project, while
others may require code changes.

Object reference not set to an instance of an object.

at PMD.FirmwareEditor.UIContextControls.UC_ContextCon figuration..ctor() in
C:\PMDRepository\Tools\DQ_Tools\FirmwareEditor\tru nk\UIContextControls\UC_Co
ntextConfiguration.cs:line 142
-------------------------------------------------------------------------- --------------------
Now I don't see any problems with the code indicated in the above error. I have no idea why this is happening or how to fix it. I really hope that
someone has solved this or knows of a workaround. :(

Jan 22 '06 #2
Awesome, nice catch!

This code was offensive to the designer for some reason
<code>
string ampValues =
ConfigurationManager.AppSettings.Get("UIAmpRangeOp tions");
// string[] values = ampValues.Split('|');
</code>

Why? I don't know, by commenting out the second line, it works fine(and
subsequent references to ampValues)

I tried to explicitly initialize the string array with this code
<code>
string[] values = null;
if (values != null)
{
values = ampValues.Split('|');
}
</code>

now it works fine.

Do you see the reason? Is c# getting a little more strict with
initializations? I'm confused still, but I thank you that I no longer have
a gun to my head :) (my whiskey bottle is still empty though, you didn't
fix that)

Have a good weekend!

"Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in message
news:Op**************@tk2msftngp13.phx.gbl...
Sounds like something may be going wrong when the designer is attempting
to
create an instance of the UC_ContextConfiguration control. Have you gone
through the constructor for the UC_ContextConfiguration class to see if
something might be causing an exception?

--
Tim Wilson
.NET Compact Framework MVP

"sklett" <as**@fkd.com> wrote in message
news:uY**************@tk2msftngp13.phx.gbl...
This BUG that is so ridiculous I can't believe they shipped 05 is making

my
life hell. I have tried the various solutions found on the web and none

of
them have worked thus far. What's even more troublesome is that it

appears
that 05 uses these new partial classes which would makes rolling back to

03
not possible.

The error I get when trying to load my Form in the designer is as
follows:
--------------------------------------------------------------------------

--------------------
One or more errors encountered while loading the designer. The errors are
listed below. Some errors can be fixed by rebuilding your project, while
others may require code changes.

Object reference not set to an instance of an object.

at PMD.FirmwareEditor.UIContextControls.UC_ContextCon figuration..ctor()
in

C:\PMDRepository\Tools\DQ_Tools\FirmwareEditor\tru nk\UIContextControls\UC_Co
ntextConfiguration.cs:line
142
--------------------------------------------------------------------------

--------------------

Now I don't see any problems with the code indicated in the above error.

I
have no idea why this is happening or how to fix it. I really hope that
someone has solved this or knows of a workaround. :(


Jan 22 '06 #3
> <code>
string ampValues =
ConfigurationManager.AppSettings.Get("UIAmpRangeOp tions");
// string[] values = ampValues.Split('|');
</code> I would assume that the "UIAmpRangeOptions" setting could not be found and
"null" was returned. If you then attempted to call a method (Split) on a
null reference you'd get a NullReferenceException thrown in the constructor,
which, in turn, thwarted the designers attempt to instantiate the control.
<code>
string[] values = null;
if (values != null)
{
values = ampValues.Split('|');
}
</code> The code in the "if" statement should never be getting executed here.
"values" is set to "null" and then a check to see if "values" does not equal
null is made on the next line. This "if" check should fail every time.

Try looking at the return value of the "AppSettings.Get" call. The return
value, stored in "ampValues", may be "null".

--
Tim Wilson
..NET Compact Framework MVP

"sklett" <as**@fkd.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... Awesome, nice catch!

This code was offensive to the designer for some reason
<code>
string ampValues =
ConfigurationManager.AppSettings.Get("UIAmpRangeOp tions");
// string[] values = ampValues.Split('|');
</code>

Why? I don't know, by commenting out the second line, it works fine(and
subsequent references to ampValues)

I tried to explicitly initialize the string array with this code
<code>
string[] values = null;
if (values != null)
{
values = ampValues.Split('|');
}
</code>

now it works fine.

Do you see the reason? Is c# getting a little more strict with
initializations? I'm confused still, but I thank you that I no longer have a gun to my head :) (my whiskey bottle is still empty though, you didn't
fix that)

Have a good weekend!

"Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in message
news:Op**************@tk2msftngp13.phx.gbl...
Sounds like something may be going wrong when the designer is attempting
to
create an instance of the UC_ContextConfiguration control. Have you gone
through the constructor for the UC_ContextConfiguration class to see if
something might be causing an exception?

--
Tim Wilson
.NET Compact Framework MVP

"sklett" <as**@fkd.com> wrote in message
news:uY**************@tk2msftngp13.phx.gbl...
This BUG that is so ridiculous I can't believe they shipped 05 is making
my
life hell. I have tried the various solutions found on the web and
none of
them have worked thus far. What's even more troublesome is that it

appears
that 05 uses these new partial classes which would makes rolling back
to 03
not possible.

The error I get when trying to load my Form in the designer is as
follows:
-------------------------------------------------------------------------

- --------------------
One or more errors encountered while loading the designer. The errors
are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes.

Object reference not set to an instance of an object.

at PMD.FirmwareEditor.UIContextControls.UC_ContextCon figuration..ctor()
in

C:\PMDRepository\Tools\DQ_Tools\FirmwareEditor\tru nk\UIContextControls\UC_Co ntextConfiguration.cs:line
142
-------------------------------------------------------------------------

- --------------------

Now I don't see any problems with the code indicated in the above error.
I
have no idea why this is happening or how to fix it. I really hope

that someone has solved this or knows of a workaround. :(



Jan 22 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

26 posts views Thread by Michel Rouzic | last post: by
2 posts views Thread by dana lees | last post: by
oll3i
10 posts views Thread by oll3i | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.