Umbraco Image Processor not cropping images - image

Having same issue as many others in regards to Umbraco ImageProcessor not cropper. I am currently using Version 7.4 but 7.3 also does not crop image at all.
I am using Azure Blob storage, with CDN have followed configuration setup to the a tee.
Full image is getting uploaded into Azure Storage via Umbraco Back Office but have tried various formatted URL requests to pull and crop image but none have worked whether JPG or PNG file. No cropping occurs at all, always full image is returned.
Using fiddler, I can see that the request is going to Azure Blob to retrieve image, but no matter the crop size, always returns full image size.
http://localhost:10876/media/1022/grower.jpg?center=0.70666666666666667,0.505&mode=crop&width=100&height=50&rnd=130950810990000000
Packages Config ...
<package id="ImageProcessor" version="2.3.1.0" targetFramework="net452" />
<package id="ImageProcessor.Web" version="4.4.1.0" targetFramework="net452" />
<package id="ImageProcessor.Web.Config" version="2.2.4.0" targetFramework="net452" />
<package id="ImageProcessor.Web.Plugins.AzureBlobCache" version="1.0.5.0" targetFramework="net452" />
<package id="UmbracoFileSystemProviders.Azure" version="0.5.0-beta" targetFramework="net452" />
Web Config ...
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
<remove name="UrlRewriteModule" />
<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
<remove name="UmbracoModule" />
<add name="UmbracoModule" type="Umbraco.Web.UmbracoModule,umbraco" />
<remove name="ImageProcessorModule" />
<add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web" />
<remove name="ScriptModule" />
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<remove name="ClientDependencyModule" />
<add name="ClientDependencyModule" type="ClientDependency.Core.Module.ClientDependencyModule, ClientDependency.Core" />
<!-- Needed for login/membership to work on homepage (as per http://stackoverflow.com/questions/218057/httpcontext-current-session-is-null-when-routing-requests) -->
<remove name="FormsAuthentication" />
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
</modules>
<httpModules>
<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="UmbracoModule" type="Umbraco.Web.UmbracoModule,umbraco" />
<add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web" />
<add name="ClientDependencyModule" type="ClientDependency.Core.Module.ClientDependencyModule, ClientDependency.Core" />
</httpModules>

The issue I was having was due to a miss-understanding on how to setup the CloudImageService within the security.config file. As mentioned I found when I stepped through the code, that although I had remote image service configured, it was not using it. The key was the prefix attribute within CloudImageService must be set to Media/ so that it aligns to the image URL path startswith .. http://localhost:1234/media/image.png...
Once I had that setup correctly I am now able to see changes when I request different width/height etc. That only took me a week to resolve.

I had a similar issue, however none of the solutions I read online worked, or my config was already set as suggested, and I manually checked all dll versions and all were fine.
What finally resolved the issue for me is I changed the .NET Version from 4.5.2 to 4.6 This essentially broke my build, and the project would not work, so I reverted back to 4.5.2, the project built and ran again, and the cropping now worked!
I suspect the .NET versions are immaterial, but the act of changing versions flushed out the error.

Related

After uninstalling WebDav on Windows Server 2016 it pops back to life after a day

We host an API that needs PUT/DELETE verbs to interact and this thing keeps coming up.
At first i figured out I need to ditch webdav to fix the 405 error and went for the solutions described here: "405 method not allowed" in IIS7.5 for "PUT" method
I removed handler, module and edited web.config
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
<remove name="WebDAV" />
<remove name="BundleModule" />
<add name="BundleModule" type="System.Web.Optimization.BundleModule" />
<remove name="TelemetryCorrelationHttpModule" />
<add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" preCondition="integratedMode,managedHandler" />
<remove name="ApplicationInsightsWebTracking" />
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
</modules>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<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>
</system.webServer>
Now the tricky part: I removed webDav with the add/remove Feature and completly deinstalled it and thats it for the day.
But when I login the server and test the verbs on the next day, the error is back and the feature is back installed on the server. I checked the log files for reboots and updates and found nothing peculiar.
Has anyone any idea what I am doing wrong? Any hints are much apprecicated.

Where is the package sources location

I use VS 2015 .Where in the visual studio project store the setting of Tools>options >Nuget Package Manager >Package Sources's setting. Currently Nuget.org is checked for Package Sources.I want to point this to a different location other than https://www.nuget.org/api/v2/, by editing the file location.
I checked the project file csproj, but did not find it
I need to change this manually in the server to point to the server repository. Working fine in local machine but not in the server.
This is a per-user setting, and is stored in %APPDATA%\NuGet\NuGet.Config. The file looks like:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="Abc" value="http://def/nuget/" />
<add key="Package source" value="http://packagesource" />
</packageSources>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
</configuration>
Simply add another entry into the <packageSources> element. (Mine is obviously updated for the protocol version 3 and so is referencing https://api.nuget.org/v3/index.json rather than https://www.nuget.org/api/v2/).

500 Internal Server Error requesting any resource files (css, js, images) in an .Net MVC 3 site

UPDATE: Things I tried - see answer below for solution
I installed a fresh MVC3 site and it served up the resources properly. That eliminated the machine.config settings as a problem.
I then when section by section in the web.config to see if any particular changes in web.config caused the problem. When the configs were identical, the fresh site still worked and the old site was still broken.
I uninstalled IIS, reinstalled IIS, and then installed apps again in an attempt to clear any settings that were lingering around. Still borked.
I then used publish (instead of msi deploy) to new directory. I used the iis option to "Create Application" on new directory of exact same code that is broken. Things worked perfectly.
I assumed file permissions, so I deleted offending directory and renamed new working version to old directory name. Site was still borked. This made me assume that some iis setting that is not in the machine.config or web.config is to blame.
I used IIS 6 Metabase explorer (yes I used it on IIS 8 site) and saw quite a few entries that were not in the working site. After deleting one by one, I found it was the "scriptMaps" entry that was being added during our MSI install causing a problem. This was added to automatically add wildcard mappings during install. It works on IIS6, but apparently not on IIS8.
We have an webforms and MVC3 application that look like one application. This is deployed in many environments (2003, 2008, Win 7) and works properly. I have just set these applications up on a new Windows Server 2012 machine and everything works except getting resource files for the MVC site. The browser gets a
500 Internal Server Error
Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.
Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
The resources are referenced in the _layout.cshtml
<head>
<meta http-equiv='X-UA-Compatible' content='IE=EmulateIE8' />
<title>#this.Title</title>
<script type="text/javascript" src="#Url.Content("~/Scripts/2012.2.607/jquery-1.7.1.min.js")"></script>
<script type="text/javascript" src="/Sentri7/scripts/jquery-p1s.banner.js"></script>
<script type="text/javascript" src="/Sentri7/scripts/jquery-p1s.patientsearch.js"></script>
<link type="text/css" rel="stylesheet" href="/sentri7/content/jquery-p1s.patientsearch.css"></link>
<link type="text/css" rel="stylesheet" href="/sentri7/content/jquery-p1s.banner.css" />
<link type="text/css" rel="stylesheet" href="/quantifi/resources/application/css/jqueryui/jquery-ui-1.7.2.custom.css" />
<link type="text/css" rel="stylesheet" href="/quantifi/resources/application/css/styles.css" />
#(RenderSection("PageHead", required: false))
</head>
as well as using the telerik scriptmanager:
#{
Title = "Reportable Conditions";
SelectedSubTab = SubTabIndex.Reportables;
Html.Telerik().ScriptRegistrar().DefaultGroup(dg => dg
.Add("~/Scripts/ReportableConditions/List.js")
.Add("~/Scripts/ClientObjects/GridSettings.js"))
.OnDocumentReady("bootStrapUI()");
}
If I try to navigate directly to the javascript file, I get the same error:
http://[server]/S7D/Scripts/2012.2.607/jquery-1.7.1.min.js
Some weird stuff:
If I IISReset and hit the js file, it will work the first request only.
Any js, css, or image requested from another (webforms) site (same app pool) on the server works fine.
There is nothing in the event log related to this 500 error.
I have tried adding permissions full permissions to the user that the app pool is running. I have also added file permissions to the [Machine]\IUSR.
Here is my web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<configSections>
<sectionGroup name="telerik">
<section name="webAssets" type="Telerik.Web.Mvc.Configuration.WebAssetConfigurationSection, Telerik.Web.Mvc" requirePermission="false" />
</sectionGroup>
<sectionGroup name="spring">
<section name="typeAliases" type="Spring.Context.Support.TypeAliasesSectionHandler, Spring.Core" />
<section name="context" type="Spring.Context.Support.WebContextHandler, Spring.Web" />
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
</sectionGroup>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<spring>
<context>
<!-- Load web.config definition ** This resource reference is essential to define objects in the web.configs -->
<resource uri="config://spring/objects" />
<resource uri="assembly://CAS2/CAS2.CASLibDAO/_SpringObjects.xml" />
<resource uri="file://~/App_Data/MvcApplicationContext.xml" />
<resource uri="assembly://P1S.S7D.Core/P1S.S7D.Core.ApplicationContext/ApplicationContext-Common.xml" />
<resource uri="assembly://P1S.S7D.Core/P1S.S7D.Core.ApplicationContext/ApplicationContext-DAO.xml" />
<resource uri="assembly://P1S.S7D.Core/P1S.S7D.Core.ApplicationContext/ApplicationContext.xml" />
<resource uri="assembly://P1S.S7D.Core/P1S.S7D.Core.ApplicationContext/Services.xml" />
<resource uri="assembly://P1S.S7D.Common/P1S.S7D.Common.ApplicationContext/ApplicationContext-AuthModule.xml" />
<resource uri="assembly://P1S.S7D.Common/P1S.S7D.Common.ApplicationContext/ApplicationContext-Web-Common.xml" />
<resource uri="assembly://P1S.S7D.Core/P1S.S7D.Core.ApplicationContext.WCF/ApplicationContext.xml" />
<resource uri="assembly://P1S.S7D.Core/P1S.S7D.Core.ApplicationContext/ApplicationContext-Circular-Reference-IPReporting.xml" />
</context>
<objects xmlns="http://www.springframework.net">
<!--cached objects-->
</objects>
</spring>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="P1S.S7D.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="P1S.S7D.Web.Mvc" />
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
<add namespace="Telerik.Web.Mvc.UI" />
</namespaces>
</pages>
</system.web.webPages.razor>
<appSettings>
<add key="Spring.Data.NHibernate.Support.OpenSessionInViewModule.SessionFactoryObjectName" value="NHibernateSessionFactory" />
<add key="Spring.Data.NHibernate.Support.OpenSessionInViewModule.EntityInterceptorObjectName" value="MultiTenantInterceptor" />
<add key="webpages:Version" value="1.0.0.0" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<sessionState allowCustomSqlDatabase="true" mode="SQLServer" sqlConnectionString="Server=dev-ct-nhsn.dev.rph.int;Database=aspstate;User ID=UID;Password=*****; Application Name=S7DSharedSession" />
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear />
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
<pages pageBaseType="P1S.S7D.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="P1S.S7D.Web.Mvc" />
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
<add namespace="Telerik.Web.Mvc.UI" />
</namespaces>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</controls>
</pages>
<httpHandlers>
<add verb="GET,HEAD" path="asset.axd" validate="false" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc" />
</httpHandlers>
<httpModules>
<add name="AuthenticationModule" type="Web.Handlers.AuthenticationModule,P1S.S7D.Web.Mvc" />
<add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web" />
<add name="OpenSessionInView" type="Spring.Data.NHibernate.Support.OpenSessionInViewModule, Spring.Data.NHibernate31" />
</httpModules>
<customErrors mode="Off" />
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web" />
<add name="AuthenticationModule" type="Web.Handlers.AuthenticationModule,P1S.S7D.Web.Mvc" />
<add name="OpenSessionInView" type="Spring.Data.NHibernate.Support.OpenSessionInViewModule, Spring.Data.NHibernate31" />
</modules>
<!-- -->
<handlers>
<remove name="asset" />
<add name="asset" preCondition="integratedMode" verb="GET,HEAD" path="asset.axd" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NHibernate" culture="neutral" publicKeyToken="aa95f207798dfdb4" />
<bindingRedirect oldVersion="3.1.0.4000" newVersion="3.3.1.4000" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<telerik>
<webAssets useTelerikContentDeliveryNetwork="false" />
</telerik>
</configuration>
All the resources, whether using Telerik or adding them with the script tag give the 500 error. The controller and view show up correctly (without styles or javascript)
EDIT:
Register Routes:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
RouteTable.Routes.RouteExistingFiles = false;
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
I was getting the same error when I published my site from local (Windows 7) to the server (Windows 2012).
My Local IIS had added this code:
<staticContent>
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/x-font-woff" />
</staticContent>
Where as I needed this on Win 2012
<staticContent>
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/x-font-woff" />
</staticContent>
It seems the newer version of IIS on Win2012 already has .woff added and instead of giving me any kind of details, it just went 500!
As mentioned in my edits. The problem was an incorrect IIS setting that I found with the IIS 6 Metabase Explorer.
I used IIS 6 Metabase explorer (yes I used it on IIS 8 site) and saw quite a few entries that were not in the working site. After deleting one by one, I found it was the "scriptMaps" entry that was being added during our MSI install causing a problem. This was added to automatically add wildcard mappings during install. It works on IIS6, but apparently not on IIS8.
I am not sure why the files would get served up properly on the first request, but not subsequent requests, but removing the entry worked. I could not find the "ScriptMaps" setting anywhere in the IIS GUI, but it is probably there somewhere.
To my situation, I met this error when running my application on Window 8.0.
After I changed the mini type of .woff from 'font/x-woff' to 'application/x-font-woff' in IIS, it works well.(after I changed the mini type, my web config added '' into staticContent automatically)

.Net Web API No HTTP resource was found that matches the request URI

I am working on .Net Web API which is working fine in debug as well as on localhost IIS but when i publish this to server it starts giving following error :-
"Message": "No HTTP resource was found that matches the request URI
On server, we have application folder under default site for this API, but it's working fine in application folder under local IIS's default site so that should not be the problem.
Now i tried setting proper verb in handler as specified in following url but didn't work:
HTTP 404 Page Not Found in Web Api hosted in IIS 7.5
Also i have MVC4 installed on server as suggested on following url:
.NET Web Api - 404 - File or directory not found
Also WebDav module, handler may give error so i also tried removing it but it's giving same error.
Here is the Web.config section for module, handler settings :-
<modules runAllManagedModulesForAllRequests="true" />
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="*" modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll"
preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="*" modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll"
preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
I am not playing with routes anywhere. Am i missing something regarding settings/configuration in web.config or server IIS ?
This works for me:
<remove name="WebDAV"/>
I don't know why it is installed on the server. But this seems to have interference with extensionless handlers
From IIS (http://www.iis.net/learn/install/installing-publishing-technologies/installing-and-configuring-webdav-on-iis):
Microsoft released a new WebDAV extension module that was completely
rewritten for Internet Information Services (IIS) 7 and above on
Windows ServerĀ® 2008. This new WebDAV extension module incorporated
many new features that enable Web authors to publish content better
than before, and offers Web administrators more security and
configuration options. Microsoft has released an update to the WebDAV
extension module for Windows ServerĀ® 2008 that provides shared and
exclusive locks support to prevent lost updates due to overwrites.
Another potential reason for this is if the
GlobalConfiguration.Configure(WebApiConfig.Register);
is after
RouteConfig.RegisterRoutes(RouteTable.Routes);
in global.asax.cs
It needs to be before, otherwise the default RouteConfig route 'eats' the WebAPI route - and attempts to map API requests to a controller called API...
Change to:
<validation validateIntegratedModeConfiguration="false" />
<modules>
<remove name="WebDAVModule"/>
</modules>
<handlers>
<remove name="WebDAV"/>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>

Deploying and Configuring ODP.NET to work without installation with Entity Framework

How do you deploy and configure ODP.NET to work without installation with Entity Framework?
A. How to deploy and configure Oracle.DataAccess.Client?
B. How to deploy and configure Oracle.ManagedDataAccess.Client?
C. What do you need to do in order to make builds with EDMXs with Oracle SSDLs work?
D. What do you need to install for designer support?
This answer summarizes (hopefully) all the steps required, many of which documented in various places online and might save someone hours of Googling.
A. How to deploy and configure Oracle.DataAccess.Client.
A.1. Download ODAC112030Xcopy_64bit.zip or ODAC112030Xcopy_32bit.zip.
A.1.1. Extract the content of the following folders within the zip file into your application/host's bin/setup folder:
A.1.1.1. instantclient_11_2
A.1.1.2. odp.net4\bin\
A.1.1.3. odp.net4\odp.net\bin\
A.1.1.4. odp.net4\odp.net\PublisherPolicy\4\
A.2. Add the following section to the beginning of your application's/host's app.config/web.config (if you already have a configSections element, add the section to it:
<configSections>
<section name="oracle.dataaccess.client"
type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
A.3. Add the following sections to the end of your application's/host's app.config/web.config:
A.4. From the ODAC112030Xcopy's folder Run:
configure.bat odp.net4 somename
I recommend using oraclehome112030_32 or oraclehome112030_64 as the "somename" above.
<system.data>
<DbProviderFactories>
<!-- Remove in case this is already defined in machine.config -->
<remove invariant="Oracle.DataAccess.Client" />
<add name="Oracle Data Provider for .NET"
invariant="Oracle.DataAccess.Client"
description="Oracle Data Provider for .NET"
type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
</DbProviderFactories>
</system.data>
<oracle.dataaccess.client>
<settings>
<add name="bool" value="edmmapping number(1,0)" />
<add name="byte" value="edmmapping number(3,0)" />
<add name="int16" value="edmmapping number(5,0)" />
<add name="int32" value="edmmapping number(10,0)" />
<add name="int64" value="edmmapping number(19,0)" />
<add name="int16" value="edmmapping number(38,0)" />
<add name="int32" value="edmmapping number(38,0)" />
<add name="int64" value="edmmapping number(38,0)" />
</settings>
</oracle.dataaccess.client>
B. How to deploy and configure Oracle.ManagedDataAccess.Client.
B.1. Download ODP.NET_Managed_1120350_Beta.zip
B.1.1. Extract the following files into your application/host's bin/setup folder.
B.1.1.1. Oracle.ManagedDataAccess.dll
B.1.1.2. x64\Oracle.ManagedDataAccessDTC.dll or x86\Oracle.ManagedDataAccessDTC.dll
B.2. Add the following section to the beginning of your application's/host's app.config/web.config (if you already have a configSections element, add the section to it:
<configSections>
<section name="oracle.manageddataaccess.client"
type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.112.3.50, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</configSections>
B.3. Add the following sections to the end of your application's/host's app.config/web.config:
<system.data>
<DbProviderFactories>
<!-- Remove in case this is already defined in machine.config -->
<remove invariant="Oracle.ManagedDataAccess.Client" />
<add name="ODP.NET, Managed Driver"
invariant="Oracle.ManagedDataAccess.Client"
description="Oracle Data Provider for .NET, Managed Driver"
type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.112.3.50, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</DbProviderFactories>
</system.data>
<oracle.manageddataaccess.client>
<version number="*">
<settings>
<!-- Set this path if you are using TNS aliases as connection strings (not recommended) -->
<!-- Instead you can use "SERVER_NAME:PORT/SERVICE_NAME" as your data source -->
<setting name="TNS_ADMIN" value="C:\"/>
</settings>
<edmMappings>
<edmMapping dataType="number">
<add name="bool" precision="1"/>
<add name="byte" precision="2" />
<add name="int16" precision="5" />
</edmMapping>
</edmMappings>
</version>
</oracle.manageddataaccess.client>
C. For building:
C.1. Add this section to your EDMX's assembly's app.config:
(Haven't tried this with Oracle.ManagedDataAccess.Client yet)
<oracle.dataaccess.client>
<settings>
<add name="bool" value="edmmapping number(1,0)" />
<add name="byte" value="edmmapping number(3,0)" />
<add name="int16" value="edmmapping number(5,0)" />
<add name="int32" value="edmmapping number(10,0)" />
<add name="int64" value="edmmapping number(19,0)" />
<add name="int16" value="edmmapping number(38,0)" />
<add name="int32" value="edmmapping number(38,0)" />
<add name="int64" value="edmmapping number(38,0)" />
</settings>
</oracle.dataaccess.client>
C.2. Add a file named Oracle.xsd to the same assembly with the content:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="odpnetappconfigmappings" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="addtype">
<xs:attribute name="name" type="xs:string" />
<xs:attribute name="value" type="xs:string" />
</xs:complexType>
<xs:complexType name="settingstype">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="add" type="addtype" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="oracledataaccessclienttype">
<xs:sequence minOccurs="0" maxOccurs="1">
<xs:element name="settings" type="settingstype" />
</xs:sequence>
</xs:complexType>
<xs:element name="oracle.dataaccess.client" type="oracledataaccessclienttype" />
</xs:schema>
C.3. Add the above XSD to the above app.config's list of Schemas.
C.4. If you are getting errors for boolean mappings during build even though build is succeeding, add the app.config mappings to Visual Studio's devenv.exe.config.
C.5. If you want to use Oracle.ManagedDataAccess.Client, either edit data provider attribute in the EDMX manually prior to build (I have not tried this) or edit it prior to creation of Context at run time and load MSSL from edited copy instead of from resource (this seems to work and I also use a similar trick to choose which MSSL to load for different DB providers).
D. For designer support:
D.1. Download win64_11gR2_client.zip or win32_11gR2_client.zip and install.
D.1.1. Select "Administrator" as type of installation.
D.2. download ODT and install.
I tried this (A and B) on a blank machine (VM) with Windows 7 x64.
This procedure does not seem to work with x86 version of Oracle.DataAccess.Client on Windows x64.
The procedure does seem to work with the x64 version of Oracle.DataAccess.Client on Windows x64 and with both versions of Oracle.ManagedDataAccess.Client.
Update:
Migrating from Oracle.DataAccess.Client to Oracle.ManagedDataAccess.Client v12.1.0 (12c) the easy way:
Edit:
Download link for managed ODAC v12c Release 1.
If you download winx64_12c_client.zip or winnt_12c_client32.zip, extract them and install (full (admin) installation or custom installation with ODP.NET component, client installation doesn't include this component) on a VM, you'll find the folder \odp.net\managed under the "client" folder.
Within this folder you will find common\Oracle.ManagedDataAccess.dll, x86\Oracle.ManagedDataAccessDTC.dll and x64\Oracle.ManagedDataAccessDTC.dll.
Copy Oracle.ManagedDataAccess.dll into your bin directory and either copy the correct platform of Oracle.ManagedDataAccessDTC.dll under your x86/x64 bin directory or, per client, install the correct platform of that specific DLL into the GAC, keeping your bin as AnyCPU.
The assembly version of the new DLL is 4.121.1.0, the PublicKeyToken seems to be the same (didn't check it, but it worked without me changing it).
As before, add this section to your app.config configuration/configSections (at the beginning of the app.config file):
<configuration>
<configSections>
Section:
<section name="oracle.manageddataaccess.client"
type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
and close with:
</configSections>
Under system.data/DbProviderFactories (after the above):
<system.data>
<DbProviderFactories>
add:
<remove invariant="Oracle.DataAccess.Client" />
<remove invariant="Oracle.ManagedDataAccess.Client" />
To make sure you don't have any conflicts in your machine.config
then add:
<add name="ODP.NET, Managed Driver" invariant="Oracle.DataAccess.Client"
description="Oracle Data Provider for .NET, Managed Driver"
type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
and close with:
</DbProviderFactories>
</system.data>
Notice I used Oracle.DataAccess.Client as the invariant instead of the official Oracle.ManagedDataAccess.Client. This is because I do not want to change all my EDMXs and recompile their assemblies to get them to use the new managed client instead of the old unmanaged one.
Then add the following section (after the above) to your app.config
<oracle.manageddataaccess.client>
<version number="*">
<edmMappings>
<edmMapping dataType="number">
<add name="bool" precision="1"/>
<add name="byte" precision="2" />
<add name="int16" precision="5" />
</edmMapping>
</edmMappings>
</version>
</oracle.manageddataaccess.client>
This passed my initial testing, haven't tested thoroughly yet though.

Resources