MVC4 ASP.NET Razor VS2012 project, Blog as sub folder/sub app

Topics: ASP.NET 2.0, Business Logic Layer
Aug 15, 2014 at 8:32 PM
I have an existing IIS website built using V2012, asp.net 4.0 integrated, MVC 4 and razor.

I'd like to add BlogEngine as a sub folder or sub application under the /blog folder.

I tried working with the web app, but can't seem to get it working, I keep running into various errors. Are there installation instructions on this kind of setup?

Should I try to merge the source project with my existing project instead, would that be simpler?
Aug 19, 2014 at 11:44 AM
Hi Andrew,

Your /blog folder should be an Virtual application folder with its own app_pool.

I am betting 95% chance that is your issue.

Then in your main site web.config need to set it not to inherit from Child Applications:



Use the <location> tag with an attribute of inheritInChildApplications equal to false in your root Web.Config file.
  <location path=”.” inheritInChildApplications=”false“>
    <system.web>
    …
    </system.web>
  </location> 

http://www.dondraper.com/2010/02/how-to-stop-inheritance-of-webconfig-files/


Doing those two steps should solve your issues.
Aug 20, 2014 at 12:33 AM
Hi, thanks for the response. As it turned out I eventually solved it the next evening.

I already had the sub App set up, and had previously tried the inheritInChildApplications in the parent web.config, but in the end I started from scratch, and with a clearer head realised I could just clear the namespaces from the parent and redefine the ones I needed to get BlogEngine running:
    <namespaces>
        <clear />
    <add namespace="System" />
    <add namespace="System.Web" />
    <add namespace="System.Web.UI" />
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Text" />
        <add namespace="System.Web.Optimization" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />    
     </namespaces>
(Not sure all of those are actually needed, but you get the gist)

Also in the app settings I then had to add these two keys:
    <add key="webpages:Enabled" value="true" />
    <add key="webpages:Version" value="3.0.0.0" />
and that solved my issues.
Aug 24, 2014 at 11:23 PM
@andrewdj can you post your web.config, I'm having the same battle, I've tried the location trick on the parent site's web.config, tried namespaces but still getting errors on the admin pages and some images missing.
Aug 25, 2014 at 9:17 PM
Edited Aug 25, 2014 at 9:20 PM
Not sure how helpful it'll be, as most of it was untouched (at least by me, can't be certain there were no changes made by visual studio...) but have had to split it up into 3 posts as it's a long web.config.

It might be more helpful if you say what the errors are, it might jog my memory as I probably had the same problem at some point.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <sectionGroup name="BlogEngine">
      <section name="blogProvider" requirePermission="false" type="BlogEngine.Core.Providers.BlogProviderSection, BlogEngine.Core" allowDefinition="MachineToApplication" restartOnExternalChanges="true" />
      <section name="blogFileSystemProvider" requirePermission="false" type="BlogEngine.Core.Providers.BlogFileSystemProviderSection, BlogEngine.Core" allowDefinition="MachineToApplication" restartOnExternalChanges="true" />
    </sectionGroup>
  </configSections>
  <BlogEngine>
    <blogProvider defaultProvider="XmlBlogProvider" fileStoreProvider="XmlBlogProvider">
      <providers>
        <add description="Xml Blog Provider" name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlBlogProvider, BlogEngine.Core" />
        <add connectionStringName="BlogEngine" description="Sql Database Provider" name="DbBlogProvider" type="BlogEngine.Core.Providers.DbBlogProvider, BlogEngine.Core" />
      </providers>
    </blogProvider>
    <blogFileSystemProvider defaultProvider="XmlBlogProvider">
      <providers>
        <add description="Xml Blog Provider" name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlFileSystemProvider, BlogEngine.Core" />
        <add storageVariable="BlogEngine" description="Sql Database Provider" name="DbBlogProvider" type="BlogEngine.Core.Providers.DbFileSystemProvider, BlogEngine.Core" />
        <!--<add storageVariable="\\UNCPath\BlogFiles" description="UNC Path Provider" name="UNCBlogProvider" type="BlogEngine.Core.Providers.UNCFileSystemProvider, BlogEngine.Core"/>-->
      </providers>
    </blogFileSystemProvider>
  </BlogEngine>
  <connectionStrings>
    <clear />
    <add name="BlogEngine" connectionString="Server=.\SQLEXPRESS;Database=BlogEngine;Trusted_Connection=True;" providerName="System.Data.SqlClient" />
    <!--<add name="BlogEngine" connectionString="Data Source=localhost;User ID=usernmae;Password=password;persist security info=False;initial catalog=BlogEngineFileStore;" providerName="System.Data.SqlClient"/>-->
  </connectionStrings>
  <appSettings>
    <add key="webpages:Version" value="3.0.0.0" />
    <add key="webpages:Enabled" value="true" />
    <!-- Set to WebForms causes some jQuery dependant scripts throw errors -->
    <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
    <add key="BlogEngine.FileExtension" value=".aspx" />
    <!-- You can e.g. use "~/blog/" if BlogEngine.NET is not located in the root of the application -->
    <add key="BlogEngine.VirtualPath" value="~/" />
    <!-- The regex used to identify mobile devices so a different theme can be shown -->
    <add key="BlogEngine.MobileDevices" value="(iemobile|iphone|ipod|android|nokia|sonyericsson|blackberry|samsung|sec\-|windows ce|motorola|mot\-|up.b|midp\-)" />
    <!-- The name of the role with administrator permissions -->
    <add key="BlogEngine.AdminRole" value="Administrators" />
    <!-- The name of the role for anonymous(non-authenticated) users. -->
    <add key="BlogEngine.AnonymousRole" value="Anonymous" />
    <!-- The name of the role for Editors -->
    <add key="BlogEngine.EditorsRole" value="Editors" />
    <!--This value is to provide an alternative location for storing data.-->
    <add key="StorageLocation" value="~/App_Data/" />
    <!--This value is the folder name under the StorageLocation that data for blog instances will be stored in.-->
    <add key="BlogInstancesFolderName" value="blogs" />
    <!--A comma separated list of script names to hard minify. It's case-sensitive. -->
    <add key="BlogEngine.HardMinify" value="blog.js,widget.js,WebResource.axd" />
    <!--Any data grid in the admin panel should use this value for default number of items per page.-->
    <add key="BlogEngine.GenericPageSize" value="15" />
    <!--Single Sign On Support.-->
    <add key="BlogEngine.SingleSignOn" value="false" />
    <!--Sitemap schema URL.-->
    <add key="BlogEngine.SiteMapUrlSet" value="http://www.sitemaps.org/schemas/sitemap/0.9" />
    <!--Default admin editor (~/editors/summernote/editor.cshtml is default) -->
    <add key="BlogEngine.DefaultEditor" value="~/editors/summernote/editor.cshtml" />
  </appSettings>
  <system.serviceModel>
    <services>
      <service behaviorConfiguration="AuthenticationServiceBehaviors" name="System.Web.ApplicationServices.AuthenticationService">
        <endpoint binding="basicHttpBinding" contract="System.Web.ApplicationServices.AuthenticationService" />
      </service>
    </services>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    <behaviors>
      <serviceBehaviors>
        <behavior name="AuthenticationServiceBehaviors">
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
  <system.web.extensions>
    <scripting>
      <webServices>
        <authenticationService enabled="true" requireSSL="false" />
      </webServices>
    </scripting>
  </system.web.extensions>
  <!--
    For a description of web.config changes for .NET 4.5 see http://go.microsoft.com/fwlink/?LinkId=235367.

    The following attributes can be set on the <httpRuntime> tag.
      <system.Web>
        <httpRuntime targetFramework="4.5"/>
      </system.Web>
  -->
  <system.web>
    <webServices>
      <protocols>
        <add name="HttpPost" />
        <add name="HttpGet" />
      </protocols>
    </webServices>
    <compilation targetFramework="4.5">
      <assemblies>
        <add assembly="System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Net.Http.WebRequest, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
      </assemblies>
      <!-- you may need it if you have issuew with razor/ajax in admin cshtml pages
      <buildProviders>
        <add extension=".cshtml" type="System.Web.WebPages.Razor.RazorBuildProvider, System.Web.WebPages.Razor"/>
      </buildProviders>
      -->
      <expressionBuilders>
        <add expressionPrefix="LinqLength" type="BlogEngine.Core.Compilation.LinqLengthExpressionBuilder, BlogEngine.Core" />
        <add expressionPrefix="Reflect" type="BlogEngine.Core.Compilation.ReflectExpressionBuilder, BlogEngine.Core" />
        <add expressionPrefix="Session" type="BlogEngine.Core.Compilation.SessionExpressionBuilder, BlogEngine.Core" />
        <add expressionPrefix="Server" type="BlogEngine.Core.Compilation.ServerVariableExpressionBuilder, BlogEngine.Core" />
        <add expressionPrefix="QueryString" type="BlogEngine.Core.Compilation.QueryStringExpressionBuilder, BlogEngine.Core" />
        <add expressionPrefix="Code" type="BlogEngine.Core.Compilation.CodeExpressionBuilder, BlogEngine.Core" />
      </expressionBuilders>
    </compilation>
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="auto" uiCulture="auto" />
    <httpRuntime targetFramework="4.5" enableVersionHeader="false" useFullyQualifiedRedirectUrl="true" maxRequestLength="16384" executionTimeout="3600" requestLengthDiskThreshold="16384" requestValidationMode="2.0" requestPathInvalidCharacters="&lt;,&gt;,*,\" />

    <machineKey validationKey="D9F7287EFDE8DF4CAFF79011D5308643D8F62AE10CDF30DAB640B7399BF6C57B0269D60A23FBCCC736FC2487ED695512BA95044DE4C58DC02C2BA0C4A266454C" decryptionKey="BDAAF7E00B69BA47B37EEAC328929A06A6647D4C89FED3A7D5C52B12B23680F4" validation="SHA1" decryption="AES" />
    <!--<machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" validation="SHA1" decryption="AES"/>-->

    <authentication mode="Forms">
      <forms timeout="129600" name=".AUXBLOGENGINE" protection="All" slidingExpiration="true" loginUrl="~/Account/login.aspx" cookieless="UseCookies" />
    </authentication>
    <pages enableSessionState="false" enableViewStateMac="true" enableEventValidation="true" controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID">
Aug 25, 2014 at 9:18 PM
part 2:
    <namespaces>
       <clear />
        <add namespace="System" />
        <add namespace="System.Web" />
        <add namespace="System.Web.UI" />
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Text" />
<!--        <add namespace="System.Web.Mvc.Ajax" />-->
<!--        <add namespace="System.Web.Mvc.Html" />-->
        <add namespace="System.Web.Optimization" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />    
    </namespaces>
      <controls>
        <add assembly="BlogEngine.NET" namespace="App_Code.Controls" tagPrefix="blog" />
      </controls>
    </pages>
    <customErrors mode="RemoteOnly" defaultRedirect="~/error.aspx" redirectMode="ResponseRewrite">
      <error statusCode="404" redirect="~/error404.aspx" />
    </customErrors>
    <!--<trust level="Medium"/>-->
    <membership defaultProvider="XmlMembershipProvider">
      <providers>
        <clear />
        <add name="XmlMembershipProvider" type="BlogEngine.Core.Providers.XmlMembershipProvider, BlogEngine.Core" description="XML membership provider" passwordFormat="Hashed" />
        <add name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="BlogEngine" applicationName="BlogEngine" />
        <add name="DbMembershipProvider" type="BlogEngine.Core.Providers.DbMembershipProvider, BlogEngine.Core" passwordFormat="Hashed" connectionStringName="BlogEngine" />
      </providers>
    </membership>
    <roleManager defaultProvider="XmlRoleProvider" enabled="true" cacheRolesInCookie="false">
      <providers>
        <clear />
        <add name="XmlRoleProvider" type="BlogEngine.Core.Providers.XmlRoleProvider, BlogEngine.Core" description="XML role provider" />
        <add name="SqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="BlogEngine" applicationName="BlogEngine" />
        <add name="DbRoleProvider" type="BlogEngine.Core.Providers.DbRoleProvider, BlogEngine.Core" connectionStringName="BlogEngine" />
      </providers>
    </roleManager>
    <siteMap defaultProvider="PageSiteMap" enabled="true">
      <providers>
        <add name="PageSiteMap" description="The site map provider that reads in the .sitemap XML files." type="BlogEngine.Core.Web.Controls.PageSiteMap, BlogEngine.Core" />
        <add name="SecuritySiteMap" description="Used for authenticated users." type="BlogEngine.Core.SecuritySiteMapProvider, BlogEngine.Core" securityTrimmingEnabled="true" siteMapFile="Web.sitemap" />
      </providers>
    </siteMap>
    <httpModules>
      <add name="WwwSubDomainModule" type="BlogEngine.Core.Web.HttpModules.WwwSubDomainModule, BlogEngine.Core" />
      <add name="UrlRewrite" type="BlogEngine.Core.Web.HttpModules.UrlRewrite, BlogEngine.Core" />
      <add name="CompressionModule" type="BlogEngine.Core.Web.HttpModules.CompressionModule, BlogEngine.Core" />
      <add name="ReferrerModule" type="BlogEngine.Core.Web.HttpModules.ReferrerModule, BlogEngine.Core" />
      <add name="SecurityModule" type="BlogEngine.Core.Security, BlogEngine.Core" />
      <add name="RightModule" type="BlogEngine.Core.Right, BlogEngine.Core" />
      <!--Remove the default ASP.NET modules we don't need-->
      <remove name="PassportAuthentication" />
      <remove name="Profile" />
      <remove name="AnonymousIdentification" />
    </httpModules>
    <httpHandlers>
      <add verb="*" path="file.axd" type="BlogEngine.Core.Web.HttpHandlers.FileHandler, BlogEngine.Core" validate="false" />
      <add verb="*" path="image.axd" type="BlogEngine.Core.Web.HttpHandlers.ImageHandler, BlogEngine.Core" validate="false" />
      <add verb="*" path="syndication.axd" type="BlogEngine.Core.Web.HttpHandlers.SyndicationHandler, BlogEngine.Core" validate="false" />
      <add verb="*" path="sitemap.axd" type="BlogEngine.Core.Web.HttpHandlers.SiteMap, BlogEngine.Core" validate="false" />
      <add verb="*" path="trackback.axd" type="BlogEngine.Core.Web.HttpHandlers.TrackbackHandler, BlogEngine.Core" validate="false" />
      <add verb="*" path="pingback.axd" type="BlogEngine.Core.Web.HttpHandlers.PingbackHandler, BlogEngine.Core" validate="false" />
      <add verb="*" path="opensearch.axd" type="BlogEngine.Core.Web.HttpHandlers.OpenSearchHandler, BlogEngine.Core" validate="false" />
      <add verb="*" path="metaweblog.axd" type="BlogEngine.Core.API.MetaWeblog.MetaWeblogHandler, BlogEngine.Core" validate="false" />
      <add verb="*" path="rsd.axd" type="BlogEngine.Core.Web.HttpHandlers.RsdHandler, BlogEngine.Core" validate="false" />
      <!--<add verb="*" path="css.axd" type="BlogEngine.Core.Web.HttpHandlers.CssHandler, BlogEngine.Core" validate="false"/>-->
      <add verb="*" path="*.js.axd" type="BlogEngine.Core.Web.HttpHandlers.JavaScriptHandler, BlogEngine.Core" validate="false" />
      <add verb="*" path="*.res.axd" type="BlogEngine.Core.Web.HttpHandlers.ResourceHandler, BlogEngine.Core" validate="false" />
      <add verb="*" path="rating.axd" type="BlogEngine.Core.Web.HttpHandlers.RatingHandler, BlogEngine.Core" validate="false" />
      <add verb="*" path="opml.axd" type="BlogEngine.Core.Web.HttpHandlers.OpmlHandler, BlogEngine.Core" validate="false" />
      <add verb="*" path="blogml.axd" type="BlogEngine.Core.Web.HttpHandlers.BlogMLExportHandler, BlogEngine.Core" validate="false" />
      <add verb="*" path="sioc.axd" type="BlogEngine.Core.Web.HttpHandlers.Sioc, BlogEngine.Core" validate="false" />
      <add verb="*" path="apml.axd" type="BlogEngine.Core.Web.HttpHandlers.Apml, BlogEngine.Core" validate="false" />
      <add verb="*" path="foaf*.axd" type="BlogEngine.Core.Web.HttpHandlers.Foaf, BlogEngine.Core" validate="false" />
      <add verb="*" path="*.htm" type="System.Web.StaticFileHandler" />
    </httpHandlers>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <!-- Enable the staticContent section below to add Expires headers to images for better performance.
         Some hosting providers does not allow the staticContent section to be set. -->
    <!--
    <staticContent>
      <clientCache httpExpires="Sun, 29 Mar 2020 00:00:00 GMT" cacheControlMode="UseExpires"/>
      <mimeMap fileExtension=".mp4" mimeType="video/mp4"/>
    </staticContent>
    -->
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="WebDAVModule" />
      <add name="WwwSubDomainModule" type="BlogEngine.Core.Web.HttpModules.WwwSubDomainModule, BlogEngine.Core" />
      <add name="UrlRewrite" type="BlogEngine.Core.Web.HttpModules.UrlRewrite, BlogEngine.Core" />
      <add name="CompressionModule" type="BlogEngine.Core.Web.HttpModules.CompressionModule, BlogEngine.Core" />
      <add name="ReferrerModule" type="BlogEngine.Core.Web.HttpModules.ReferrerModule, BlogEngine.Core" />
      <add name="SecurityModule" type="BlogEngine.Core.Security, BlogEngine.Core" />
      <add name="RightModule" type="BlogEngine.Core.Right, BlogEngine.Core" />
    </modules>
Aug 25, 2014 at 9:19 PM
final part:
    <handlers accessPolicy="Read, Write, Script, Execute">
      <add name="FileHandler" verb="*" path="file.axd" type="BlogEngine.Core.Web.HttpHandlers.FileHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <add name="ImageHandler" verb="*" path="image.axd" type="BlogEngine.Core.Web.HttpHandlers.ImageHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <add name="Syndication" verb="*" path="syndication.axd" type="BlogEngine.Core.Web.HttpHandlers.SyndicationHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <add name="Sitemap" verb="*" path="sitemap.axd" type="BlogEngine.Core.Web.HttpHandlers.SiteMap, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <add name="Trackback" verb="*" path="trackback.axd" type="BlogEngine.Core.Web.HttpHandlers.TrackbackHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <add name="Pingback" verb="*" path="pingback.axd" type="BlogEngine.Core.Web.HttpHandlers.PingbackHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <add name="OpenSearch" verb="*" path="opensearch.axd" type="BlogEngine.Core.Web.HttpHandlers.OpenSearchHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <add name="MetaWeblog" verb="*" path="metaweblog.axd" type="BlogEngine.Core.API.MetaWeblog.MetaWeblogHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <add name="RSD" verb="*" path="rsd.axd" type="BlogEngine.Core.Web.HttpHandlers.RsdHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <!--<add name="CssHandler" verb="*" path="css.axd" type="BlogEngine.Core.Web.HttpHandlers.CssHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode"/>-->
      <add name="WebResource" path="*.js.axd" verb="*" type="BlogEngine.Core.Web.HttpHandlers.JavaScriptHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <add name="Resource" verb="*" path="*.res.axd" type="BlogEngine.Core.Web.HttpHandlers.ResourceHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <add name="Rating" verb="*" path="rating.axd" type="BlogEngine.Core.Web.HttpHandlers.RatingHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <add name="Opml" verb="*" path="opml.axd" type="BlogEngine.Core.Web.HttpHandlers.OpmlHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <add name="BlogML" verb="*" path="blogml.axd" type="BlogEngine.Core.Web.HttpHandlers.BlogMLExportHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <add name="SIOC" verb="*" path="sioc.axd" type="BlogEngine.Core.Web.HttpHandlers.Sioc, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <add name="Apml" verb="*" path="apml.axd" type="BlogEngine.Core.Web.HttpHandlers.Apml, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <add name="Foaf" verb="*" path="foaf*.axd" type="BlogEngine.Core.Web.HttpHandlers.Foaf, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
      <add name="Html" path="*.htm" verb="*" type="System.Web.StaticFileHandler" resourceType="Unspecified" preCondition="integratedMode" />
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

      
      
      
      
    <remove name="ExtensionlessUrlHandler-Integrated-4.0" /><remove name="OPTIONSVerbHandler" /><remove name="TRACEVerbHandler" /><add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /></handlers>
    <!-- Enable the httpProtocol section below to manipulate some HTTP headers.
         Some hosting providers does not allow the httpProtocol section to be set.  -->
    <!--
    <httpProtocol>
      <customHeaders>
        <remove name="X-Powered-By"/>
        <add name="Etag" value=" "/>
      </customHeaders>
    </httpProtocol>
    -->
    <!-- enables compression in IIS 7
    <urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="true"/>
    -->
    <staticContent>
      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" cacheControlCustom="public" />
      <remove fileExtension=".ico" />
      <mimeMap fileExtension=".ico" mimeType="image/x-icon" />
      <remove fileExtension=".woff" />
      <mimeMap fileExtension=".woff" mimeType="font/x-woff" />
    </staticContent>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Practices.Unity" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
Aug 26, 2014 at 2:57 AM
@andrewdj thanks.. that got me closer. The issue I have now is resources :

CS0122: 'Resources.labels' is inaccessible due to its protection level

I've tried changing the resources to embedded rather than app_globalresource but then they are not accessible from server controls that use $Resource: Resources.labels, key
Aug 27, 2014 at 2:53 AM
Well after 3 days of hell I have given up on this. There are so many issues with this project that it's just a rabit hole of dll hell and iis errors.

First up, the global resources problem. When running as a sub application, I get

CS0122: 'Resources.labels' is inaccessible due to its protection level

All the usual solutions, such as changing the customtool etc did not work in expressions like <%$ Resources: labels, name %>

So I converted the global resources to embedded resources, and added a custom ExpressionBuilder to mimick the default Resources one, so that I didn't have to change all the references. That worked fine.

After messing with the config for ages, I got the app running, but the admin pages give a variety of errors, all complete rabit holes where one solution after another just throws up another error. I spent ages going though all the nuget references, getting everything to compatible versions... still a bunch of different errors.

I think there are issues with the mixed design of this app, with the admin pages using razor to serve up the main page for the angularjs admin app. I tried converting it to real mvc, where there is a controller and a view (I have a lot of experience with mvc), but just ended up with more errors that had no real solutions (missing methods, view doesn't inherit from webpages etc).

I'm disappointed, I really like the project, it's clean and simple as a platform, but I needed it to run as a sub app under my DNN7 install, which just doesn't seem possible.