Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / May 2004

Tip: Looking for answers? Try searching our database.

Severe limitation for IE-hosted .NET controls (classid is truncated to 128 chars)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
M. Shawn Dillon - 07 May 2004 23:17 GMT
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.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.