2nd Prob - Error Design Time Html

  • Thread starter Thread starter Mythran
  • Start date Start date
M

Mythran

We have a web control. (Please note, all our libraries and controls are given a
strong name). When we place the web control on a web page, it works fine. We
are using a project reference to it in our sample application. Sometimes
immediately following a build/rebuild, it displays the design time error html.
We have tracked the problem down to the first line in GetErrorDesignTimeHtml() (I
believe that's the method's name, I just woke up). That line is Dim ourObj As
OurObject = DirectCast(component, OurObject).

The exception message given is along the lines of "invalid type cast". Now, how
is "Dim a As b = DirectCast(c, b)" when c is passed into the routine as follows?:
Public Sub GetSomething(ByVal c As b) Just doesn't make sense to me.

Note: I have found that when I do a build, the exe can't be overridden (it shows
up in the task list when I build but is removed just as fast). I have to build
over and over in order to make out which file can't be over-written. The
permissions are not an issue. I believe vstudio is over-writing a file that it
has locked between builds but can't be sure....

Any help is appreciated,

Thanks,

Mythran
 
The exception message given is along the lines of "invalid type cast".
Now, how
is "Dim a As b = DirectCast(c, b)" when c is passed into the routine as follows?:
Public Sub GetSomething(ByVal c As b) Just doesn't make sense to me.

Why do you need to cast c at all as you already did this casting in the
function signature, you probably are not passing the right type to the
function at run time.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing
 
* "Mythran said:
believe that's the method's name, I just woke up). That line is Dim ourObj As
OurObject = DirectCast(component, OurObject).

The exception message given is along the lines of "invalid type cast". Now, how
is "Dim a As b = DirectCast(c, b)" when c is passed into the routine as follows?:
Public Sub GetSomething(ByVal c As b) Just doesn't make sense to me.

I don't see any reason for using 'DirectCast' in this situation. What
about removing the 'DirectCast'?
 
lol sorry...

The original function is the overridden function GetDesignTimeHtml(ByVal
component As Object).

I am not passing component, the framework is ;)

After more testing I found that component (the object) is the previous
version of the component loaded (using the designer). I checked the
references but they are all project references...so that doesn't help me
much (solving the prob). So, any more suggestions?

Thanks,

Mythran
 
Back
Top