Sunday, 9 October 2011

Installing ActiveX using installer

In the installer project in the FileSystem View add the activex project's primary output, and set property "Register" to "vsdrpCOM", doing this ensures the installers installs and removes the ActiveX control from the system.

If using in JavaScript and ActiveX control is not initializing then go to security setting and click customise and update "initialize and script activex controls not marked as safe for scripting" from disable to "enable (not secure)", 

Note: this is not the recommended setting, only provide here for development purpose only, not for deployment scenario.

To implement an activex control which is safe to execute see following post


http://www.atalasoft.com/cs/blogs/rickm/archive/2009/06/03/net-2-0-activex-control-gotchas-safe-for-scripting-and-hooking-into-events.aspx

Monday, 3 October 2011

Https website losing the selected certifictate setting.

I have configured a website and assigned it to a SSL certificate, site works fine, but after some time the site looses the certificate. in order to resolve use

Configuring your wildcard to cover additional host headers (subdomains) on your server.
Once you have this configured you then need to run the following command (found in C:\Windows\System32\Inetsrv\) for each site you want to secure (IE: Site1.yourdomain.com, Site2.yourdomain.com, etc):

appcmd set site /site.name:"<SiteName>" /+bindings.[protocol='https',bindingInformation='*:443:<HostHeader>']



Replace <SiteName> with your name of your site (IE: MyWebsite2), and replace <HostHeader> with your sub domain (IE: site1.mydomain.com)


Return to IIS and you will now see that your sites have a HTTPS binding with a host header and the SSL certificate that was specified for your Default Web Site is selected, and it is also bound using your wildcard SSL.
One last point to make here is that if you try to edit this binding IIS will delete the host header and change the SSL certificate back to ‘Not Selected’. If this happens you will need to delete the binding and re-run the command line to add it again.