Q305624 hosting controls from the filesystem

I'm attempting to host a windows forms control derived from the local
filesystem in an html page within IE 6 according to the procedures layed out
in http://support.microsoft.com/default.aspx scid=kb;en-us;Q305624

to test this I've been using the SimpleHost example from the SDK's quick
start samples (
\QuickStart\winforms\samples\writingcontrols\simplecontrol\ )
* this is the example used to demo IE control hosting from IIS using the
object tag.

Q305624 essentially tells you to generate a public / private key pair ,
attribute this within your assembly manifest , and to compile your project
to produce a strongly named assembly. You then add this to the GAC. The last
step is to register the assembly using regasm.

I've done all of this and confirmed that everything's valid in both the GAC
and registry. No errors or warnings were apparent in generating any of these
steps.

also have set AssemblyDelaySign to false
and utilized an object tag of the appropriate form
<object id="simplecontrol"
classid="CLSID:29AB64F8-C80F-30DF-AB7A-6215ABBF0F52"
codebase="simplecontrol.dll#-1,-1,-1,-1">

when attempting to load the control using the associated clsid , derived
from the reg entry , I get "your current security settings prohibit running
activex controls on this page. As a result the page may not display
correctly".  A small square appears , but the control never loads.

Lowering IE's security domain has no effect. Interestingly I get the same
error when attempting to load the control in an HTA. This leads me to
believe that this is not actually a standard IE security domain violation.

this feature is undocumented beyond the PRB article.
____________________
has anyone successfully hosted a control from the file system in an html
page within IE 6 

I'm assuming that this is some sort of app domain ( ) security violation ,
but am not sure of how to remedy it.

I'm attempting this on a win98 using framework v1.0.3705

I'd really appreciate any advice a/o leads on resolving this

thanks


Answer this question

Q305624 hosting controls from the filesystem

  • The Unknown P

    I think that I've discovered the cause of the problem.

    I'd been using a common assembly name for each generation of tests - deleting and unregistering previous builds , and then adding and re-registering each subsequent attempt.  It appears that by using a common name among these test assemblies I'd been relying on a corrupted GAC registration. Once I'd registered the test assembly on a clean machine everthing worked fine , re-registering under a new assembly name on the original machine seems to confirm that the original test's GAC image was corrupted.

    so the MS advisory is basically correct. There are a few points that aren't mentioned but are probably essential

    use a GUID attribute , don't rely on the clsid provided by regasm - eg. [System.Runtime.InteropServices.Guid("0B14392F-9E56-4650-9510-D18372FEC62E")]

    have the control inherit from UserControl

    make sure that the AssemblyDelaySign attribute is false

    don't attempt to re-add , re-register assemblies w/ the same name as unsuccessful ones.


  • Q305624 hosting controls from the filesystem