Solmetis

Notes, links and general development stuff

  • Home
  • About
RSS

Macro to connect to Development Server

Posted on 2012/03/11 by solmetis
Comments off

A macro to allow you quickly attach the debugger to either the Visual Studio Development Server or to IIS Express, if that’s what you’re using.

   Public Module Module1
       Public Sub AttachToDevServer()
           For Each process As EnvDTE.Process In DTE.Debugger.LocalProcesses
               If (process.Name.IndexOf("iisexpress.exe") <> -1
                       Or process.Name.IndexOf("WebDev") <> -1) Then
                   process.Attach()
               End If
           Next
       End Sub
   End Module
Categories: Development

Setting up SSL on an IIS7 Development Server

Posted on 2012/03/11 by solmetis
Comments off

A quick note about setting up a development server with SSL.

Steps:

  • Generate a certificate
  • Create an SSL binding to an existing site
  • Test the configuration

Generating a Certificate

Note that, if you’ve installed IIS Express, you may already have a certificate (named ‘IIS Express Development Certificate’ ) installed in the store. If you have, and you want to use that one, you can safely skip this section altogether.

  1. Working in "Internet Information Services Manager", make sure that the root (server) is selected in the left-hand pane.
  2. In the Features View, double-click ‘Server Certificates’ to open the feature.
  3. In the ‘Actions’ panel on the right-hand side, click “Create Self-Signed Certificate” and provide a ‘friendly’ name in the dialog that appears: this is there so that you can differentiate one certificate from another.

You should have see a new certificate installed into you certificates list.

Creating an SSL Binding

  1. Working in "Internet Information Services Manager" again, this time select the site that you want to configure in the left-hand pane.
  2. In the ‘Actions’ panel on the right-hand side of the window, double-click ‘Bindings’, under the ‘Edit Site’ heading: this will show the ‘Site Bindings’ dialog.
  3. Click the ‘Add’ button on the dialog to show the ‘Add Site Binding’ window.
  4. Select ‘https’ from the ‘Type’ dropdown and the certificate that you want to use from the ‘SSL Certificate’ dropdown.
  5. ‘Ok’ out of the two ‘Add Site Binding’ window, and ‘Close’ the ‘Site Bindings’ dialog. This will return you to the main “Internet Information Services” window.

At this point, you should have an SSL binding to your site.

Testing the Configuration

All that remains to be done now, is to test that the configuration is correct. In the ‘Actions’ panel at the right-hand side of the "Internet Information Services Manager" window, there should be two entries in the ‘Browse Web Site’ section:

  • Browse <your-site-name> on *:80 (http)
  • Browse *:443 (https)

Clicking on the first of these, you should see the default page for your site served normally via http.

Clicking the second like (https), your browser will normally generate a certificate warning. This is (generally) fine for the development, because you’re using a Self-Signed Certificate.

Accept the certificate warning, and you should see your site served up over SSL.

Note:If you want to force your site to use SSL, simply double-click the ‘SSL Settings’ widget in the Features View for your site on the “Internet Information Services” window, tick the ‘Requires SSL’ checkbox on the ‘SSL Settings’ page that appears, and click ‘Apply’ from the ‘Actions’ panel on the right-hand side.

Categories: Development, Internet Information Services
  • Categories

    • Development
    • Internet Information Services
  • Pages

    • About
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
© Solmetis. Proudly Powered by WordPress | Nest Theme by YChong