Attempt by security transparent method failed

If you are seeing the following:

Attempt by security transparent method ‘Microsoft.Web.Mvc.ScriptExtensions.Script(System.Web.Mvc.HtmlHelper, System.String)’ to access security critical type ‘System.Web.Mvc.MvcHtmlString’ failed.

or something similar chances are you’ve recently updated your project from MVC 4 to 5 and didn’t update all the references in nuget to target the new version. In my case the MVC4Futures nuget package should be removed and the Microsoft.AspNet.Mvc.Futures package should be used instead.

Read More

Enable “PUT” and “DELETE” verbs in IIS 7+

Is your newly created RESTful Service returning a 405 on your PUT and DELETE actions when running in IIS 7? If so you may need to disable WebDAV.

A quick way to check is to pop the following lines into a Web.config in the root of your application and try again.

<system.webServer>
 <modules>
  <remove name="WebDAVModule" />
 </modules>
 <handlers>
  <remove name="WebDAV" />
 </handlers>
</system.webServer>

UPDATE 2016-04-22: For those .NET users, if your server is still not responding to DELETE or PUT check to ensure that the ExtensionlessUrl-Integrated-4.0 handler is setup to handle the verbs by dropping these additional settings in your web.config

<system.webServer>
    <modules>
      <remove name="WebDAVModule" />
    </modules>
    <handlers>
      <remove name="ExtensionlessUrl-Integrated-4.0" />
      <remove name="WebDAV" />
      <add name="ExtensionlessUrl-Integrated-4.0" path="*." 
      		verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" 
      		type="System.Web.Handlers.TransferRequestHandler" 
      		resourceType="Unspecified" requireAccess="Script" 
      		preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
  </system.webServer>

Read More

Announcing Camstruction

camstruction-logo-tile

” Camstruction is the world’s first web and mobile application designed to streamline the entire documentation process for your projects. From taking important photos of your project to providing them as documentation when necessary, Camstruction gives you the ability to do so much more to manage your projects efficiently. “

Camstruction is made up of both a Website and an iOS Application. The prime target of Camstruction is construction / work site Inspectors. Using Camstruction an Inspector can document a work site with photos taken from their iPhone. All photos can be geotagged, date stamped and organized into a project. Photos can then be shared via a built-in sharing feature on the Website that generates a shared link that can be emailed to others. The App and Website are both kept in sync automatically as changes are made. Don’t have an iPhone, don’t worry all features are available via the Website and or mobile website as well!

Camstruction was created for a client by the name of Appvantage, Inc.
(more…)

Read More

Fixing ASP.NET web.config inheritance issues for child applications

Recently while adding a WordPress powered blog as a child application to a ASP.NET 4.5 application in IIS 7.5 I ran into this error:

Unrecognized attribute ‘targetFramework’. Note that attribute names are case-sensitive

Since /blog is setup as a PHP application and I didn’t want to turn on ASP.NET support just so I could stop inheritance through a web.config file I looked for another solution. A quick Google search pulled up this result (Changing ASP.NET web.config inheritance when mixing versions of child applications). According to the article modifying the parent applications web.config taking it from this

<system.web>
 ...your system.web stuff goes here
</system.web>

to this

<location path="." inheritInChildApplications="false">
   <system.web>
    ...your system.web stuff goes here
   </system.web>
</location>

fixes my problem. Great stuff!

Read More