StructureMap Exception in .90 on II7 on Win 7

Mar 22, 2009 at 6:29 PM
Edited Mar 22, 2009 at 6:40 PM

Now l'm not really a web developer -- and this my first attempt to use IIS7 or Windows 7 ... but I just happened to have the Win7 beta installed at home, so I ran the Web Platform Installer to get everything set up and grabbed the 0.9 source, compiled and publishing to my local machine.

Your wizard installer said that PUT and DELETE weren't working right ... but when I continued, it brought up the site okay, and the categories like "blog" work okay.  However, when I try to click on an individual item to view it's page, eg: http://localhost/blog/2009/03/08/WelcomeToAtomSite09.xhtml ... I got the following error message. I've included the stack trace etc.

Server Error in '/' Application.
StructureMap Exception Code:  200
Could not find an Instance named "OpenIdModalWidget" for PluginType AtomSite.WebCore.IWidget
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: StructureMap.StructureMapException: StructureMap Exception Code:  200
Could not find an Instance named "OpenIdModalWidget" for PluginType AtomSite.WebCore.IWidget

Source Error:

Line 1:  <%@ Master Language="C#" AutoEventWireup="true" Inherits="ViewMasterPage<PageModel>" %>
Line 2:  <% Model.SetPageName(Page); %>
Line 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
Line 4:  <html xmlns="" xml:lang="en">

Source File: c:\inetpub\wwwroot\themes\default\Site.Master    Line: 2

Stack Trace:

[StructureMapException: StructureMap Exception Code:  200
Could not find an Instance named "OpenIdModalWidget" for PluginType AtomSite.WebCore.IWidget]
   StructureMap.BuildSession.CreateInstance(Type pluginType, String name) +234
   StructureMap.Container.GetInstance(String instanceKey) +51
   AtomSite.WebCore.<>c__DisplayClass1e.<SetPageName>b__13(Include include) in C:\Users\Joel\Projects\AtomSite\WebCore\PageModel.cs:101
   System.Collections.Generic.List`1.ForEach(Action`1 action) +76
   AtomSite.WebCore.PageModel.SetPageName(Page page) in C:\Users\Joel\Projects\AtomSite\WebCore\PageModel.cs:101
   ASP.themes_default_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\inetpub\wwwroot\themes\default\Site.Master:2
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +115
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +240
   System.Web.UI.Page.Render(HtmlTextWriter writer) +38
   System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +89
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4240

Version Information: Microsoft .NET Framework Version:2.0.50727.3521; ASP.NET Version:2.0.50727.3521


Mar 23, 2009 at 9:30 PM
It sounds like the OpenIdPlugin could not install it's resources.  Did the write access check during the wizard complete ok?

You could temporarily disable the OpenIdPlugin in the service.config file and restart the application.

    <plug:type>AtomSite.Plugins.OpenIdPlugin.OpenIdPlugin, AtomSite.Plugins.OpenIdPlugin, Version=, Culture=neutral, PublicKeyToken=null</plug:type>

If that fixes things, you could try forcing a re-install of the OpenIdPlugin by setting installed to false and enabled to true.  

Also, you should check the log files to see if there are any errors.  The log files are located in App_Data.
Mar 24, 2009 at 4:21 AM
Edited Mar 24, 2009 at 4:22 AM
This turned out to be a filesystem permissions problem... Somehow my Windows 7 IIS defaulted to using a built in account which did not have full access to the wwwroot folder.