I am using IE 6 with all patches applied on Windows Server 2003 and Windows
XP SP1.
Recently, I installed the tech preview of Visual Studio .NET 2005 and
attempted to view the IE Sourcing QuickStart sample to see if it had the
same problems. It does (IE Binding log information is below), but I think
I'm wrong about the 50 character limitation (the example in my previous post
was contrived based upon a past experience) because the binding information
only shows 12 characters in this case. The path leading up to the type name
(including the hash mark that separates the type and assembly) is 116
characters.
With a 12-character type name and a 116-character path, it seems that IE or
the IE CLR Host can
only read the first 128 characters of the classid attribute. Considering
that many type names themselves in .NET can exceed 128 characters,
especially if you also include the HTTP URL path information to the
assembly, this represents a severe limitation for IE-hosted controls.
***** IEHOST Error Log (Friday, 07 May 2004 17:35) *****
URL:
http://localhost/QuickStart/Winforms/Samples/WritingControls/SimpleControl/cs/Control/bin/debug/SimpleControlCS.dll
Zone: 1
Assembly Name: SimpleControlCS.dll
Type Name: Microsoft.Sa
----- Thrown Exception -----
System.TypeLoadException: Could not load type 'Microsoft.SaMicrosoft.Sa'
from assembly 'SimpleControlCS, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=null'.
at System.AppDomain.CreateComInstanceFrom(String assemblyFile, String
typeName, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
at Microsoft.IE.SecureFactory.CreateInstanceWithSecurity(Int32 dwFlag,
Int32 dwZone, String pURL, String uniqueIdString, String link, String
licenses)
Thanks,
Shawn
"Patrick Steele [MVP]" <patrick@mvps.org> wrote in message
news:MPG.1b02f4197bf4c7c79898e5@msnews.microsoft.com...
> In article <OTxh8mkMEHA.2468@TK2MSFTNGP11.phx.gbl>,
> shawn.dillon@insightbb.no-spam.com says...
> > I was recently toying with IE-hosted Windows Forms controls
(instantiated
> > via <object /> tags in HTML) and ran across a surprising (and
unfortunately,
> > showstopping for my intended uses) limitation.
> >
> > Evidently, the class name (including the namespace) is limited to 50
> > characters. For example, the following works:
> >
> > <object id="works"
classid="http://127.0.0.1/MyAssembly.dll#MyCompanyName.MyProductName.WinForm
> > s.Controls.Ctrl">
> > </object>
> >
> > While this does not:
> >
> > <object id="toolong"
classid="http://127.0.0.1/MyAssembly.dll#MyCompanyName.MyProductName.WinForm
> > s.Controls.MyCtrl">
> > </object>
> >
> > The assembly binding log viewer (IEHOST error page) indicates that the
type
> > it tried to load in the second instance was:
> > MyCompanyName.MyProductName.WinForms.Controls.MyCt
> >
> > Can anyone shed some light on why this is occurring and where this
behavior
> > may be documented or filed as a bug?
>
> It's probably related to the fact that the object tag is documented in
> the MSDN documentation to be in the format:
>
> clsid:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
>
> With that format, 50 is more than enough. But the HTML specs say
> classid is a URI:
>
> http://www.w3.org/TR/html401/struct/objects.html#adef-classid
>
> I wonder if different version of IE behave differently. What version of
> IE are you using?
Junfeng Zhang - 11 May 2004 06:26 GMT
This is an IE limitation. IEHost does not enforce any length limit.