Earlier this week,I talked about the Orcas feature where controls can declaratively request permissions in a similar way to ClickOnce applications. In fact, the manifests used for this request are the same manifests used for ClickOnce applications, with a few special requirements added onto them. When you're developing controls, its possible to have manifests which don't meet one of these requirements. In that case, the error in the manifest will be logged to the IEHost debug log in order to help you figure out what needs to be changed. Lets dig in deeper to the manifests, since they are really at the heart of this feature.
Like a ClickOnce application, IE hosted controls will have both a deployment and an application manifest. By convention, the deployment manifest will have a .control extension, while the application manifest will have a .dll.manifest extension. Both manifests are required to have a valid Authenticode and StrongName signature (a self signed certificate will work, however it must be installed in the trusted root store on the client machines so that it "chains" to a valid root). Both manifests must also be located on the same site as the control -- a control on foo.com cannot have manifest on bar.com. Similarly, a deployment manifest on bar.com cannot refer to an application manifest on baz.com.
Outside of those common requirements, each manifest has its own specific requirements. Let's look at the deployment manifest first. The requirements for the deployment manifest are:
I've attached TemplateControl.control as a template that control deployment manifests can be based upon. The first two requirements can be seen in the deployment section of the manifest:
<deployment install="false">
<deploymentProvider codebase="http://www.contoso.com/TemplateControl/TemplateControl.control" />
</deployment>
And the last one is in the dependency section:
<dependency>
<dependentAssembly codebase="TemplateControl.dll.manifest" size="1929" dependencyType="install">
<assemblyIdentity name="TemplateControl.dll" version="1.0.0.0" publicKeyToken="7bbbb9ce54f53dd4" processorArchitecture="msil" language="neutral" type="win32" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<dsig:DigestValue>QPq0hc3mZPhWUeRAthX7QefabZk=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Onto the application manifest. There are a few more rules around this manifest:
Again, I've attached TemplateControl.dll.manifest to this post to use as a template for control application manifests. You can see in the entry point section that the entry point is indeed the control (assuming the control is hosted in TemplateControl.dll), and that it should be hosted in the browser:
<entryPoint>
<assemblyIdentity name="TemplateControl" version="1.0.0.0" publicKeyToken="7bbbb9ce54f53dd4" processorArchitecture="msil" language="neutral" />
<commandLine file="TemplateControl.dll" />
<hostInBrowser xmlns="urn:schemas-microsoft-com:asm.v3" />
</entryPoint>
The permission set exists in the trustInfo section, as is the case for regular ClickOnce manifests:
<trustInfo>
<security>
<applicationRequestMinimum>
<PermissionSet class="System.Security.NamedPermissionSet" version="1" Unrestricted="true" Description="Allows full access to all resources" SameSite="site" ID="FullTrust" />
<defaultAssemblyRequest permissionSetReference="FullTrust" />
</applicationRequestMinimum>
</security>
</trustInfo>
And the dependency is the control assembly:
<dependentAssembly codebase="TemplateControl.dll" size="4608" dependencyType="install" allowDelayedBinding="true">
<dsig:DigestValue>yxh1Z4B1Maw8UoXSU+rDwsj+8bA=</dsig:DigestValue>
Unfortunately, the tools story for creating control manifests isn't all together great at this point. The easiest way that you'll be able to generate these manifests is to start with the template manifests, and then use the Mage tool that ships in the Framework SDK to update and sign them. Since Mage does not yet know about control manifests, there are a few manual steps involved:
At this point you'll have a valid application manifest for your control. Similar steps are required to setup the deployment manifest:
Now you have a pair of valid manifests to use with your control. Yes, I know that this isn't exactly ... well ... the easiest procedure in the world. Hopefully by the time we finish the release we will have a better story here, but for now these steps will allow you to play with generating controls for the CTP releases.
So now we know the overall picture of manifested IE controls in Orcas and have seen what the manifests look like and how to create them, that leaves us with one last step. Next time, we'll take a look at how we hook the whole thing up in an HTML page to get the full story working end-to-end.
[Update 3/29] Provided a link to the TemplateControl.control file